SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist hantaah's Avatar
    Join Date
    Jul 2011
    Location
    Birmingham, Uk
    Posts
    562
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    How to be selective with css?

    Say I have a home page which I've chosen to have a transparent background but then I don't want to have a transparent background for the rest of my pages.

    How do I do this and how do I know which styles to use.

    My home page is full width with the content background tranparent - http://79.170.40.244/healthmeanswealth.co.uk/
    But the content in the other pages needs to be white ( so not to show the dandelions )- http://79.170.40.244/healthmeansweal...uk/contact-us/

    I can get the whole page white but not sure how to do it just for the content area.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by hantaah View Post
    Say I have a home page which I've chosen to have a transparent background but then I don't want to have a transparent background for the rest of my pages.
    Easy. Just add a class to the body element on your hove page. E.g.

    Code:
    <body class="home">
    Then set the styles you want just for that page. E.g.

    Code:
    .home { styles here }
    or perhaps

    Code:
    .home .content { styles here }
    depending on what you want to style just on the home page.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •