|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
centering? or uhm....
How can I, let's see how to say this. Align text to the middle of a div (up and down)... not really a center
Normal: ________________________________ Text ________________________________ After: ________________________________ text ________________________________ THANKS |
|
#2
|
||||
|
||||
|
|
|
#3
|
||||
|
||||
|
As much as I dislike tables for layout, vertical centering is one area that has no CSS equivalent.
Code:
<div style="position: relative; width: 200px; height: 200px;">
<table style="height: 100%;">
<tr>
<td>
<p>Now is the time for all good men to come to the aid of
their country.</p>
</td>
</tr>
</table>
</div>
cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. |
|
#4
|
||||
|
||||
|
Well, I looked into the method in Andreas's link, but I just can't seem to get it to do anything like what it's meant to, so I agree with Gary, tables are the only way to achieve what you're after...
![]()
__________________
Support requests via PM will be ignored! |
|
#5
|
||||
|
||||
|
Quote:
It depends what the container is. Some block level elements don't position horizontally. (I'm sure there's a list somewhere) You could always use margin/padding too. -Greg
__________________
new jersey web design |
|
#6
|
|||
|
|||
|
I have learned to not use margin and padding and stuff like that... It isn't cross browser at all, firefox has one hell of a time with it. Besides, IE doesn't view the web as it is suppose to be viewed, so yea...
I'll try what was suggested about the div aligning, thanks! -Trying to stick without tables |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > centering? or uhm.... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|