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
Old 11-19-2008, 08:53 PM vertical aligning
Extreme Talker

Posts: 176
Trades: 0
I have a <td>, and inside it I have tow <div>s. I want one to align to the top, one to align to the bottom. Right now the <td> has vertical-align:top, so they both go to the top..

Any tips?
Here's the page if you want to look at it: http://skeddles.com/v4/
Skeddles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-19-2008, 09:48 PM Re: vertical aligning
andrei155's Avatar
CEO of BLD Hosting

Posts: 1,514
Name: Andrei
Location: Canada
Trades: 6
Why don't you just use two divs.

Code:
<div id=one>
</div>

<div id=two>
</div>
Now, you just give each of the ma height, and use margins to place them wherever you want.

Code:
#one{
height: 80px;
}

#two{
height: 80px;
margin-top:20px;
}
Edit:
If you want to have control over them as a whole, wrap them both in another div, and style that one too.
__________________
No Overselling Guarantee
Now Includes a Free Domain
BLD Hosting -
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
andrei155 is offline
Reply With Quote
View Public Profile Visit andrei155's homepage!
 
Old 11-20-2008, 02:25 PM Re: vertical aligning
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Hint: get rid of the tables !!! You don't need them and tables for layout should be avoided.

Vertical-align does NOT apply to divs, you need other solutions, but the first is getting rid of the tables.
__________________
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 11-20-2008, 03:31 PM Re: vertical aligning
Experienced Talker

Posts: 32
Trades: 0
I think now it's the time to switch to a CSS layout. There's still time because if you continue like this you will end up with really messy code. Also, for basic rollovers you don't need javascript. Have a look at the old but good CSS Sprites method. If you need more fancy rollovers then CSS Sprites2 is the way to go

For example:
<div class="link"><a href="home.htm" class="menu home"></a></div>
<div class="link"><a href="home.htm" class="menu home"></a></div>
<div class="link"><a href="home.htm" class="menu home"></a></div>

could easily be replaced by an unordered list.

Just my 2 cents
__________________

Please login or register to view this content. Registration is FREE
Professional PSD to XHTML coding services
tsiger is offline
Reply With Quote
View Public Profile
 
Old 11-23-2008, 12:36 AM Re: vertical aligning
Extreme Talker

Posts: 176
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Hint: get rid of the tables !!! You don't need them and tables for layout should be avoided.

Vertical-align does NOT apply to divs, you need other solutions, but the first is getting rid of the tables.
I know, everyone says that, but I cant get divs to do just what I want, when tables do.


Maybe you could help me by answering some questions:

1.When making the layout, should I put each row in a div? Or just leave things separate and line break or whatever at the end of a row.

2.How do I make certain things stretch correctly? My site needs to stretch vertically horizontally and vertically. With tables it does. How do I make sure some divs stretch, and some stay on the correct sides where they're supposed to be?

3.Why won't my divs even stay on the same line?

@tsiger: Thanks, i'll be sure to do that.

EDIT:

Okay, I tried to redesign my site completely with css.
http://skeddles.com/v4/
The problems are:
I still don't know how to fix the original problem: Two divs inside another div, one should be at the top, one at the bottom.

Also, it doesn't stretch. At all. I just don't know how to do it.


EDIT2:
I just realized the site gets completly destroyed in IE(I use FF). Any tips?

Last edited by Skeddles; 11-23-2008 at 01:58 AM..
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 11-23-2008, 11:56 AM Re: vertical aligning
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
1. it depends.

2. make some fixed widths, the others have percentage or em widths so they will adjust.

3. <div>s are block elements, so have an implied line break above and below them. Use floats to keep them on the some horizontal plane.

vertical-align will only apply to inline elements http://www.candsdesign.co.uk/referen...ertical-align/
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-23-2008, 12:45 PM Re: vertical aligning
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Skeddles, it sounds to me as if your css layout attempts might have been limited to layouts with just absolute positioning - not the best way to do a layout and does have a lot of problems associated with it. I would suggest learning how to do CSS layouts from scratch, and learn about floats.
__________________
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
 
Reply     « Reply to vertical aligning
 

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