Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Borders not forming a perfect square

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30347
    bmckim
    Member

    I recently stumbled across this technique when skinning an html video player.

    Basically you can use borders to create triangles. My issue is my left and right borders aren’t coming to points in the middle. Screenshot.

    Here is my css and html:


    #triangle span {
    border-top: 300px black solid;
    border-left: 300px gray solid;
    border-bottom: 300px blue solid;
    border-right: 300px red solid;
    }

    Any help is appreciated!

    #79092
    noahgelman
    Participant

    I think the vertical might be defaulting to your line-height. I’ve had a problem once or twice where divs wont fit snugly around an image because the line-height was giving it a little extra height (for what ever reason). If that doesn’t work, rip out each property one by one till it works. And if you still can’t get it, google and find a working example, then just grab that code and stick it on your page, make sure it works, and then adjust it to how you wanted it.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.