Adding border to CSS triangle [duplicate]

One way to do it is the create an inner triangle which is smaller. .triangle-left { width: 0; height: 0; border-top: 23px solid transparent; border-bottom: 23px solid transparent; border-right: 23px solid red; } .inner-triangle { position: relative; top: -20px; left: 2px; width: 0; height: 0; border-top: 20px solid transparent; border-bottom: 20px solid transparent; border-right: 20px … Read more

Pure CSS star shape [duplicate]

Let’s break it into pieces: The yellow borders are actually set as transparent in the final product so they don’t show. They are yellow here to show how the borders look. As commented above, this answer shows the idea behind the basic triangle shape. The div by itself: <div id=”star-five”></div> Combining the :before pseudo element … Read more

How to create cube with only HTML and CSS?

According to your HTML, I get this JSFiddle. I just played with transform. .mainDiv{ position: relative; width: 206px; height: 190px; margin: 0px auto; margin-top:100px; } .square{ width:100px; height:100px; background:#c52329; border:solid 2px #FFF; transform: skew(180deg,210deg); position: absolute; top: 43px; } .square2{ width:100px; height:100px; background:#c52329; border:solid 2px #FFF; transform: skew(180deg,150deg); position: absolute; left:102px; top: 43px; } .square3{ … Read more

CSS triangle :before element

You need to specify the content property. For positioning, add position:relative to the parent, and then absolutely position the arrow -15px to the left. jsFiddle example .d { position:relative; } .d:before { content:”\A”; border-style: solid; border-width: 10px 15px 10px 0; border-color: transparent #dd4397 transparent transparent; position: absolute; left: -15px; }