Tuesday, March 03, 2009

I have a webpage! I have a css technical question!

Today I have some announcements and some related technical questions.

1. Announcement: In the past six months, several people have asked me, where can I find your visual work, and I've said "uuuhh." So, I've been working on a webpage. It's still very much in progress, but if you'd like to read even more information about me:

http://www.spooksbyme.org

2. Technical Question: Does anyone know how to make a background stretch to fit not just the width of the screen but also the height? I have several different background images, so here's what I've done in my stylesheet:

body {
background-color: #339999;

#background2 {
background-image:url(Images/bg_about.jpg);
position:relative;
top:auto;
left:auto;
}

#background3 {
background-image:url(Images/bg_sand.jpg);
position:relative;
top:auto;
left:auto;
}

Then, I can make a div and give it either one of these backgrounds as an id and then make its width 100%. That works fine. But height 100% doesn't work.

Any thoughts?

1 comment:

Ryan W. said...

to repeat the background in a div horizontally and/or vertically...
http://www.w3schools.com/css/pr_background-repeat.asp

to set a minimum height for a div...
http://www.w3schools.com/CSS/pr_dim_min-height.asp

as far as I know, there's no way in CSS to control the size of the background image itself. You would have to edit the image in photoshop or something.