Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorspoo
    • CommentTimeMar 31st 2006
     permalink
    It's spoo again. This site rocks to every extent, I'm getting so much help. Thanks.

    I have another question. I'm noticing on some sites, they have two hover types for different links. For example, a navigation bar has one hover style, and content has another hover style, and footers have their own hover style.

    Previously, I had been using a:hover for my styles, but would often require me using bad colors just to get the links to work in both header, body, and footer so the viewer could see the links. What would be the attribute(s) to create multiple hover formats?
    •  
      CommentAuthornifkin
    • CommentTimeMar 31st 2006
     permalink
    just target different areas of the page using descendant selectors.

    /* this styles all links by default */
    a:link,a:visited,a:focus,a:hover,a:active { color:#f0c;}

    /* this only styles links in a div with an id of navbar */
    div#navbar a:link,div#navbar a:visited,div#navbar a:focus,div#navbar a:hover,div#navbar a:active { color:#cf0; }

    /* only styles links in an LI element */
    li a:link,li a:visited,li a:focus,li a:hover,li a:active { color:#c00; }
    • CommentAuthorspoo
    • CommentTimeMar 31st 2006
     permalink
    awesome, that did the trick. Next I need to learn to abbreviate my css :) Thanks nifkin.
  1.  permalink
    spoo,

    Nesting your CSS like Nifkin illustrated is important not only for hover styles, but for your code in general. If you're not nesting the styles in your CSS file you're asking for cascade trouble.
    • CommentAuthorspoo
    • CommentTimeMar 31st 2006
     permalink
    http://spoo.tysonforgod.info/style.css

    that's my stylesheet at the moment. Any suggestions how I can improve it?
  2.  permalink
    you could condense it slightly by using shorthand for your borders, for example:

    Instead of:

    border-bottom-width: thin;
    border-bottom-style: solid;
    border-bottom-color: #CCCCCC;

    You could do:

    border-bottom: 1px solid #CCC;
Add your comments
    Username Password
  • Format comments as (Help)