Forums

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

Home Forums CSS [rel=”css”]:before ?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35805
    schart
    Participant

    Why won’t this work?


    pre.code:before{
    padding-right:420px;
    border-top-left-radius:5px;
    border-top-right-radius:5px;
    padding-left:6px;
    background-color:gray;
    font-family:Trebuchet MS;
    border-bottom:1px solid #aaa;
    }

    pre.code{
    padding:0px;
    width:500px;
    border-radius:5px;
    border-left:1px solid #fff;
    border-top:1px solid #fff;
    border-right:1px solid #aaa;
    border-bottom:1px solid #aaa;
    background-color:lightgray;
    line-height:10px;
    }

    pre[rel="js"]:before {
    content:"JavaScript";

    }

    pre[rel="css"]:before {
    content:"CSS";

    }

    JS work’s, but if I change the rel to CSS or HTML, it still says HTML or CSS :before.

    #93305
    SgtLegend
    Member

    Seems to work fine for me, are the rel values exactly the same as what your targeting in your CSS?

    http://jsfiddle.net/TQxp5/

    #93339
    SgtLegend
    Member

    You will need to set a static width on your pseudo elements as at the moment they are been generated with odd widths because of your padding-right value.

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