Learn how to a build a cloud-first strategyRegister Now


Center text on entire page despite gif on the left

Posted on 2006-03-21
Medium Priority
Last Modified: 2010-04-09
In the header of my page I have a gif file left justified. Next to it is the title of the page consisting of 3 lines of text.

I want the three lines of text to the right of the image but centered on the entire page. I'm currently using a table (width 99%) and I'm getting the three lines of text centered on the enclosing cell instead if the entire page. I want the text centered on the entire page as if the image was not there.

Is there a way to do that?

Question by:adg
LVL 16

Accepted Solution

sam85281 earned 400 total points
ID: 16255120
You just need to add an extra cell to your table.

Assuming your gif is called headerGif.gif and is 300W x 100H.

Make a new gif either transparent or the color of the background of your header, 1 x 1 pixel, call it blank.gif.


<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<td width='300'>
<img src-'headerGif.gif' width='300' height='100'><br>
<td width='100%' align='center'>
<td width='300'>
<img src='blank.gif' width='300' height='100'><br>

That sets a left and right cell that are the same size, therefore your text will be centered in a cell that is in the center.


Author Comment

ID: 16255589
Thanks Sam, that was exactly what I needed.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question