Jump to content

I can not get the text to be centered vertically


jasonc

Recommended Posts

thanks for you reply.

 

you say it i can not really do this.

 

but how would i vertically center the text, how ever it is done.

 

this is what i have..

 

#container { padding: 0; width: 100%; text-align: middle; }
#left { float: left; }
.clear { height: 0; font-size: 1px; margin: 0; padding: 0; line-height: 0; clear: both; }

#div.verticaltext { vertical-align:middle; }

 

<div id="container">
  <div id="left">
   <img src="logo.jpg">
  </div><!-- left -->
  <div id="verticaltext">
      <font size="40pt">Welcome to <?=$sitename;?></font>
  </div><!-- right -->
  <div class="clear"></div>
</div><!-- container -->

1) You can't add CSS to font tags

2) Font tag is deprecated. You should only add CSS

3) You can't really vertically center stuff with CSS

 

1) Of course you can

2) But, since it is deprecated, I guess you wouldn't be using it anyway

3) Agreed

 

But, there are ways. Check out here.

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.