Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



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

Posts: 15
Name: Kyle
Trades: 0
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
 
 
Register now for full access!
Old 06-06-2008, 04:58 PM Re: Image vertical alignment
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
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;
}
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 06-06-2008, 09:03 PM Re: Image vertical alignment
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-07-2008, 08:52 AM Re: Image vertical alignment
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
is this sorta what you mean?
http://www.webmaster-talk.com/css-fo...alignment.html
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is online now
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to Image vertical alignment
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.19469 seconds with 12 queries