Jump to content

I can not get the text to be centered vertically


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...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.