|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Absolute center
I've only just started mucking round with CSS. Just by looking at other peoples sites and seeing how they do something, and then mucking around with what they've written to learn it.
What I am trying to do at the moment, is just have a blank page with at the absolute center (Vertical and Horizontal) of the screen have some text. But the text is only horizontally centered not vertically. Heres the codes: In seperate stylesheet Code:
#center {
position: absolute
width: 100%;
height: 100%;
text-align: center;
vertical-align: middle;
}
and in the page Code:
<div id="center">
<p><span class="aus">Austrlia</span><br>
<span class="contact">admin@sixfootone.com +61 412 587890</span>
</p></div>
Any ideas? Thanks |
|
#2
|
||||
|
||||
|
Right now, vertical-align doesn't seem to be supported very much. kk5st has a demo (that I'm sure he'll share, as I forget the link) to a demo of absolute-centered pages. It is one of the few instances where tables are "recommended," because of the default vertical-align: middle property. It'll look something like this:
PHP Code:
I hope this helps.
__________________
Proud member of the T.S.N.B.U.F.L (tables should not be used for layout) alliance. "Only use elements for their intended purpose. You wouldn't try to make coffee with a telephone, would you?" -Me |
|
#3
|
||||
|
||||
|
Quote:
![]() The demos are horizontal centering and vertical centering. Both are written to center a container div, but the element could just as well be a paragraph or form or any other element. 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
|
|||
|
|||
|
Thanks for the help.
After checking my orignal code out in Safari it works fine in that, but IE and Firefox don't want to work correctly. Using a table as suggested now. |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Absolute center |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|