WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] adding custom css for a page (4 posts)

  1. Drew Hart
    Member
    Posted 1 year ago #

    I would like to add the following css and only have it work on pages:

    #navlist{position:relative;}
    #navlist li{margin:0;padding:0;list-style:none;position:absolute;top:0;}
    #navlist li, #navlist a{height:44px;display:block;}
    
    #home{left:0px;width:46px;}
    #home{background:url('img_navsprites.gif') 0 0;}
    
    #prev{left:63px;width:43px;}
    #prev{background:url('img_navsprites.gif') -47px 0;}
    
    #next{left:129px;width:43px;}
    #next{background:url('img_navsprites.gif') -91px 0;} 
    
    #home a:hover{background: url('img_navsprites_hover.gif') 0 -45px;}
    #prev a:hover{background: url('img_navsprites_hover.gif') -47px -45px;}
    #next a:hover{background: url('img_navsprites_hover.gif') -91px -45px;}

    Any help on how I should format it and add it to the 2011 Style CSS would be appreciated. Many thanks in advance,

    Drew

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    You can implement a Child Theme, or more easily a Custom CSS plugin.

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    Twenty Eleven uses body_class() and therefore has a page (static page) specific css class .page in the body tag.
    http://codex.wordpress.org/Function_Reference/body_class

    add this .page to each of your css selectors to make them page specific;

    example:

    .page #navlist{position:relative;}

    btw:
    do not edit Twenty Eleven directly, but create and work with a child theme http://codex.wordpress.org/Child_Themes

  4. Drew Hart
    Member
    Posted 1 year ago #

    Thanks for the info - I think I will use the .page method in a child theme. Thanks again,

    Drew

Topic Closed

This topic has been closed to new replies.

About this Topic