Support » Themes and Templates » How can i apply CSS to different pages using a templates own Custom CSS sheet?

  • Hello,

    I am using Custom CSS feature of a template to add my CSS. I am not using stylesheets phps. My problem is when i write css there it applies it to every page in the site.. Here in the main page (www.spor101.com) everything is perfect. But when i click a page the post is out of the page (like this http://www.spor101.com/?p=15) because i applied css to #content. Is there a way to fix this and apply css only to main page with using the templates css feature? Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • your theme uses body_class()http://codex.wordpress.org/Function_Reference/body_class

    the main page for instance has the css class .home

    use those css classes to distinguish between posts and pages or even individual posts or pages.

    to find out which classes are present, use a tool such as Firebug http://getfirebug.com/

    Thread Starter enerdo

    (@enerdo)

    Thank you.. I am using firebug yes. I am not editing css in .php files as i said, i am using the templates CSS editor. I added css like the following to that editor.. How will i make these apply to .home and not to other pages? Thank you very much for your help, i know i am an amateur 🙂

    [CSS code moderated – a link to your site is enough to access the styles]

    Thread Starter enerdo

    (@enerdo)

    I found it 🙂 I just add .home infront of the #xxx and it works… Thank you again.. Do you know what to write to change it only in pages? .page?

    you can give custom css to page by creating the page template.and apply all you css (class and ids)and if you want same change occur in all pages then make changes in page.php as you want.

    Thread Starter enerdo

    (@enerdo)

    what is the alternatife of .home to apply css to pages only? I tried .page but it did not work..

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How can i apply CSS to different pages using a templates own Custom CSS sheet?’ is closed to new replies.