SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strange css code

    I stumbled upon this piece of code :

    Code:
    #main ul a.selected {
      margin-bottom:0;
      color:#000;
      background:snow;
      border-bottom:1px solid snow;
      cursor:default;
      }
    #main div {
      padding:10px 10px 8px 10px;
      *padding-top:3px;
      *margin-top:-15px;
      clear:left;
      background:snow;
      height: 300px ;
    }
    I know what most of this code does, but I wonder what that asterisks and that snow value do!
    Any ideas?
    Thank you.

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,267
    Mentioned
    116 Post(s)
    Tagged
    1 Thread(s)
    Well snow is a color name for #FFFAFA, apparently, so that's just setting the background color to #FFFAFA. The * would be the universal selector hack (I think....). Here is SP thread which might help: http://www.sitepoint.com/forums/show...-In-A-CSS-Rule
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  3. #3
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Close dave, it's actually the invalid character hack for IE7 and lower.
    http://www.webdevout.net/css-hacks#u...sterisk_prefix

    As a rule of thumb if you need hacks to do margin or padding adjustments like that, there's something wrong with how the page is built.

  4. #4
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,267
    Mentioned
    116 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    Close dave, it's actually the invalid character hack for IE7 and lower.
    http://www.webdevout.net/css-hacks#u...sterisk_prefix

    As a rule of thumb if you need hacks to do margin or padding adjustments like that, there's something wrong with how the page is built.
    Crap - thought I had it right.

    Your rule of thumb is pretty accurate though as I've never needed to use it, or if I found a need for this hack (and I've had to fight IE7 on down a lot), I reworked it to find a better way to code the page and style it.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •