Forums

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

Home Forums CSS [Solved] How can I target 2 selector id's to work only on a specific page ?

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

    How can I target 2 selector id’s to work only on a specific page ?
    This affects the whole site and this is how it appears on firebug :

    #main {
        margin-top: 42px;
    }

    I want to change it only on this post #post-6418

    how would I write this correctly as in firebug both codes only work with the # symbol ( id selector) and not one id and one class selector.

    the following does not work how would i write this correctly ,

    #post-6418  #main {
        margin-top: 0;
    }
    #184860
    __
    Participant

    How would I write this …only work with the # symbol ( id selector) and not one id and one class selector.

    Well, are you trying to select classes or IDs?

    the following does not work how would i write this correctly

    We can’t answer that without knowing what you are trying to do. The code you posted will select an element with the id “main”, if it is the child of an element with the id “post-6418”.

    So, what are you trying to select? Perhaps it would be helpful to make an example on codepen?

    #184865
    Paulie_D
    Member
    
    .singular-page-6418 #main {
    margin-top:0;
    }
    
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.