- This topic is empty.
-
AuthorPosts
-
August 24, 2011 at 2:28 pm #34069mwdewittMember
How do I place this background image behind the header and the footer, repeating it on the “X” and “Y” axis? I already have written in my CSS…
body {
font-size: 16px;
font-family: Myriad Pro, Arial, Helvetica, sans-serif;
color: #000000;
background-color: #FFFFFF;
background-image: url(images/header-bg.png);
background-repeat: repeat-x;
background-position: center top;
}…which seems to make it so I can not put another background image on my page. Thank you in advance for any help you can give me!
August 24, 2011 at 2:52 pm #85630zackwMemberbody {
font-size: 16px;
font-family: Myriad Pro, Arial, Helvetica, sans-serif;
color: #000;
background:#fff url(images/header-bg.png) repeat;
}or if you want it just on the header and footer
#header, #footer {
background:#fff url(images/header-bg.png) repeat;
}if you apply it to the body u can still have other background images on the page but each element can only have 1 bg image, unless your using css3 but that’s prolly above your current css knowledge
August 24, 2011 at 3:10 pm #85633mwdewittMemberOkay, I did something to that effect. Here is the CSS code for the body…
body {
font-size: 16px;
font-family: Myriad Pro, Arial, Helvetica, sans-serif;
color: #000000;
background-color: #FFFFFF;
background-image: url(images/body-bg.png);
background-repeat: repeat;
}…and here is the CSS code for the header…
#header {
background-color: #000000;
background-image: url(images/header-bg.png);
background-repeat: repeat-x;
background-position: center top;
}…now, how do I get my website to recognize the #header CSS code? You can see what is happening to my website. There is currently no header.
August 24, 2011 at 3:17 pm #85636zackwMemberchange #header in your style sheet to #top-bar since that is what you named your div
August 24, 2011 at 3:24 pm #85638mwdewittMemberIt still does not pick up the header-bg and it is only spanning 960 pixels, even if I change it to #top-bar. Again, you can visit my website to see what is happening now. Thank you, so far!
August 24, 2011 at 3:31 pm #85639zackwMemberits only spanning 960px because its inside your pagewrap.. if you want the bg to expand the whole way you must take it out of the pagewrap, this will however make your content inside the header go outside the page wrap as well so you will need to include one inside the header
Content Hereim not sure why it isn’t picking up your bg image, check its spelling and make sure you’ve got the correct path
P.S. if your gonna use another page-wrap inside your the header that means you will have 2 of them on the page so you should change them from an id to a class
August 24, 2011 at 3:42 pm #85641zackwMemberit looks like your bg-header.png image is just a 180px tall black img, maybe you saved it down improperly from photoshop… download firebug for firefox its a really helpful web development tool, especially for de-bugging problems
August 24, 2011 at 3:53 pm #85644mwdewittMemberI did it! Look at this shmexiness!
August 24, 2011 at 4:00 pm #85646zackwMember:)
August 24, 2011 at 4:03 pm #85647mwdewittMemberYeah, the header-bg.png file is only 1 pixel wide, repeated along the x-axis, and along the top. It takes less time to load than having a big, complicated header. I am so happy. I think I am finally done with this website.
August 24, 2011 at 4:19 pm #85649zackwMemberyup thats the proper way to do it, but really its just 2 flat colors that you could have achieved with css without even having to use an image – but the way you did it is fine
August 24, 2011 at 4:39 pm #85650mwdewittMemberActually, if you notice, there is a gradient at the bottom of the header and at the top of the footer, giving the impression that the body-bg is behind it. I do not know how to achieve that with CSS.
August 25, 2011 at 11:22 am #85704mcguiver178Memberthis is a big help for me man…
use it in the future: http://www.colorzilla.com/gradient-editor/
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.