• I know that css style the whole site but is there anyway to use css for one particular page and not affect the others pages?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Yes, you can usually use the generated class or ID for a specific page to specify the CSS for that page only. If you look at the generated code for a page — the body tag should have something like class=”page-id-5″ in it — so then you would use that like this:

    .page-id-5 {
    CSS styles;
    }

    Depending on the rest of the CSS styles, you might have to make the above more specific to override other styles.

    If you have a more specific thing you are trying to do and a link to your site, someone can probably give you more precise help.

    Thread Starter charlietech

    (@charlietech)

    Thank you so much. So if its the front page, then just do that code for front page and it should work? It work affect the other pages css?

    Thread Starter charlietech

    (@charlietech)

    What if its the default sidebar?it move down on the front page and Im trying to get it back to the top of the page without messing up the other pages sidebar. Only the homepage sidebar is messed up.

    What if its the default sidebar?it move down on the front page and Im trying to get it back to the top of the page

    post a link to your site – without seeing the problem live, there is not much to suggest.

    droped sidebars can have all sorts of causes – invalid html, missing divs, html errors in post content, ans rarely css.

    have you checked the validity of your code, for instance with http://validator.w3.org/ ?

    Thread Starter charlietech

    (@charlietech)

    The code is the same as the buddypress and the theme. on all the other pages, the sidebar is align correctly but im only having problem with the index page.

    Thread Starter charlietech

    (@charlietech)

    test.xertionfitness.com

    http://validator.w3.org/check?uri=http%3A%2F%2Ftest.xertionfitness.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

    refers to these lines:

    <h3>Recent Activities/ Questions<h3>
          </div><!-- content -->
        </div><!-- main col -->

    see the missing / in the closing for the h3;

    Thread Starter charlietech

    (@charlietech)

    Thnak you so much for helping with that but the sidebar is still under the activity stream on the main page and aligned with all the other pages. Kinda the same place I was in. If i move it it on the home page. it will move on all the other pages too. how can i just align it on the index page without it tempering with the others?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Css only on index.php’ is closed to new replies.