|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
css position from bottom AND center?
Ok, css is great for some things, but I can't figure out how to position something x pixels from the bottom and still center it (yes i've tried replacing the center tags with a div that has text-align:center)
PHP Code:
any ideas? I could use javascript to get the page width, then (pagewidth/2)-(textwidth/2) would give me centered text...but getting the page width is unreliable most of the time...so i'd rather solve it some way closer to what i've started. thanks.
__________________
PHP and XML Let's talk about SAX |
|
#2
|
||||
|
||||
|
got inspiration from some picture resizing thread i saw...see, the center is centered, within the div, which is only the width of the text itself, and since i didn't give it a left that's why it pulled the the very left (normal flow). But, if i make the containing div 100% the width of the page (width:100%) then the center has room to work and will center on the page, and even grow/shrink as the page resizes.
|
|
#3
|
||||
|
||||
|
you shouldn't use tags like font and center.
both have been deprecated, use css to control the layout. Code:
<div style="position:absolute; bottom:0px; text-align:center; color:#c0cccc; font-size:0.8em; width:100% "> © 2004 Drew Peterson <br /> All Rights Reserved </div> |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > css position from bottom AND center? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|