Reply
Image vertical alignment
Old 06-06-2008, 03:37 PM Image vertical alignment
Average Talker

Posts: 15
Name: Kyle
So I have a div and I want to have 2 divs inside it, one with a background image at the top, the other with a background image at the bottom.

Code:
 
div.main {
 float: left;
 height: 100%;
 width: 5px;
        background-color: blue;
}
div.top {
 position: fixed;
 top: 0px;
 background-color: red;
 height: 30px;
 width: 100%;
}
div.bottom {
 position: fixed;
 bottom: 0px;
 background-color: green;
 height: 30px;
 width: 100%;
}
The image I want at the bottom is displaying just underneath the top one. Any ideas on how to get it to go to the bottom of the div (not bottom of page!) would be appreciated. Thanks!
kmoore11 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 06-06-2008, 03:58 PM Re: Image vertical alignment
wayfarer07's Avatar
$frontend->developer

Posts: 1,037
Name: Abel Mohler
Location: Asheville, North Carolina USA
Hmmm.... I don't see any background-images in your code at all. Anyway, here is how it is done (this is shorthand):

Code:
div.mine {
background: url(../images/myimage.gif) center bottom no-repeat #cb0;
}
This could also be expressed like this:
Code:
div.mine {
background-image: url(../images/myimage.gif);
background-repeat: no-repeat;
background-position: center bottom;
background-color: #cb0;
}
__________________
Go FREELANCE <=|If a donkey eats a melon, it is still a donkey... |=> Hire Me
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 06-06-2008, 08:03 PM Re: Image vertical alignment
LadynRed's Avatar
Super Moderator

Posts: 6,557
Location: Tennessee
Whenever you float an element, you MUST define a width.
The height: 100% won't work unless it's parent is also set at height: 100%.

Position:fixed isn't supported by IE6 - and it's not the best way to do what you seem to want to do either.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-07-2008, 07:52 AM Re: Image vertical alignment
KkillgasmM's Avatar
Ultra Talker

Posts: 361
Name: El Phantasmo
Location: England, north west
is this sorta what you mean?
http://www.webmaster-talk.com/css-fo...alignment.html
__________________
New Portfolio
KkillgasmM is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Image vertical alignment
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13135 seconds with 12 queries