SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Style background on body doesn't appear

    Well guys, I'm trying to put two backgrounds on the site, a specific index and one for the other pages.
    I have looked and saw a solution:
    Place an id in the body and the CSS reference that id.
    Well, okay so my code:

    Code CSS:
    body {background: url (images/bg-topo.png) repeat-x;}
    body#index {background: url (images/bg-corpo.png) repeat;}

    Only I'm using Wordpress, taking the header and dynamicist blabla as you know. So I can not reference a body for each page.

    I wonder how can I solve this problem :P

    Who wants to take a look: www.intimesoft.com.br/site, click on the A Empresa and the page index.

  2. #2
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    You don't have the CSS rules you posted above in your stylesheet which is why it's not working.

    In your stylesheet you have this:

    Code CSS:
    body#index{background: url(imagem/bg-topo.png) repeat-x;}
    html {background: url(imagem/bg-corpo.png) repeat;}
    Maleika E. A. | Rockatee | Twitter | Dribbble



  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still not working @kohoutek. I copied and pasted your code.

  4. #4
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Maleika E. A. | Rockatee | Twitter | Dribbble



  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, I thought it was to copy the style you put it.
    Can you explain, better?

    Whats CSS rules you said?

  6. #6
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Someone?

  7. #7
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,163
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    I think kohoutek's point is that you have typos in the code on your site. On the two lines in question, your code reads imagem, when it should read images, as you've stated in your post.

  8. #8
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    What I'm trying to tell you is that you do not have the code you posted in your first post in your stylesheet, hence why it can't work. I pasted the code that you currently use in your stylesheet and they are entirely different from the code you posted in your first post. Copy and paste the code you posted here (in your first post) into style.css and you should be good to go, unless I'm misunderstanding something.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  9. #9
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    I think kohoutek's point is that you have typos in the code on your site. On the two lines in question, your code reads imagem, when it should read images, as you've stated in your post.
    Err.. the translator must have translated, but it says "imagem".

  10. #10
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's the same code. Each modification that I changed I upload on the server at the same time

  11. #11
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    I see you now added the correct CSS rules to your stylesheet.

    What you'd need to do now is have a reference to the #index ID exclusively.

    To do that, you need to work with a conditional function.

    In your header.php, go to the opening body tag and do something like this:

    Code PHP:
    <body <?php if (is_home()) { ?>id="index"<?php } ?>>


    This should read, "if it's the homepage, append an id of index".

    Is that what you meant?
    Maleika E. A. | Rockatee | Twitter | Dribbble



  12. #12
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes! Thank you.
    This tag in php, is there a specific name? Only works with elements of global style?

  13. #13
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Well, it's a conditional tag, more specifically, a WordPress conditional tag. You can do loads with it. For more information, please see this page.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  14. #14
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks kohoutek.
    Problem solved.


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
  •