Forums

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

Home Forums CSS “#” sign before property

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38264
    rzea
    Member

    Hello,

    I tried looking around the open web but couldn’t find anything, although there was an answer on Yahoo! Answers the ‘answer’ didn’t really say anything other than “[# is for IDs]” (no need to post the link of course).

    This is a bit more advanced.

    When reviewing the CSS code from a co-worker I found he used the # sign before several CSS properties.

    What does the # sign before property do? That’s gotta be some IE targeting hack I’m assuming.

    For example:

    .selector { #property:value; }

    or well:

    .headings { #margin-top:10px; }

    I thought I knew a lot about CSS but this one caught me by surprise, especially that there’s isn’t any documentation of this case out there on the open web other than that answer in Yahoo! Answers.

    Any info about this is greatly appreciated.

    Thanks.

    #103617
    Paulie_D
    Member

    The hashtag as it’s called means that it applies to an named element with an ‘id’




    You can then target this div directly with your CSS.



    #insertname {

    height: 250px;

    }

    for instance.

    #103619
    rzea
    Member

    Hello Paulie,

    Thanks for your comment, but I think you didn’t read my question correctly. I wasn’t asking what is the # sign in CSS, I was asking about using the # sign within a CSS property.

    Anyway, I found the answer: Is a CSS hack for IE7 and below.

    Browser CSS hacks: http://paulirish.com/2009/browser-specific-css-hacks/
    The hash hack: http://www.kryogenix.org/code/browser/csshacks/hash

    Thanks!

    #103621
    Senff
    Participant

    If your co-worker really used that as a hack….it’s a terrible one in my opinion. Besides, using hacks in this day and age are really unnecessary.

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