OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
How to Write VALIGN in CSS
This page's ID:
10934
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
OK... the first step is to stop thinking in terms of tables. There is no VALIGN in CSS. You do have positioning, though, and you can give your block elements absolute (position:absolute) or relative (position:relative) positioning. Absolute positioning means that whatever measurements you specify, they are calculated from the end of the previous block element. In other words, your block elements will flow one after another, and if you specify top:20px (for example) with relative positioning, your element should start 20px after the previous element ends. Absolute positioning starts everything from the upper-left corner of the screen. So, if you want vertical spacing (not alignment), you should use something like top:??px. If you're looking to vertically align something in the center of the page, you can always give it top:50% (with absolute positioning, of course). Note that the element will [b]start[/b] at the halfway mark, so it won't be exactly centered. One way to get around this would be to give the element a negative top margin of half its height (which might be difficult if you don't know the height, of course). Um, I hope I'm not going into too much detail here. The main thing I want to stress, though, is that you shouldn't be "converting" your coding skills. That implies that you want to overlay CSS on your table-based design philosophy. That's not the way it works. You need to forget about using tables for layout and start fresh with CSS. I know it's difficult to let go (everyone goes through it), but it is a necessary step. Good luck with your quest. :) [Edit: For clarification: Rather than thinking, "OK, how can I do this table technique in CSS?" you need to think, "OK, what is CSS, and what can I do with it?"] [This message has been edited by Suho1004 (edited 03-10-2003).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »