Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text - center screen 1

Status
Not open for further replies.

seanbo

Programmer
Jun 6, 2003
407
GB
how can i get some text center screen? this is what i have so far:

<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<style type=&quot;text/css&quot;>
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
vertical-align: middle;
text-align: center;
top: 50%;
}
-->
</style>
</head>

<body>
<table width=&quot;100%&quot; height=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr>
<td align=&quot;center&quot; valign=&quot;middle&quot;>
<p class=&quot;style1&quot;>
<strong><img src=&quot;universal/oops.gif&quot; width=&quot;19&quot; height=&quot;16&quot;> Oops</strong>! <img src=&quot;universal/oops.gif&quot; width=&quot;19&quot; height=&quot;16&quot;><br>
We hope to get this feature working as soon as possible
</p>
</td>
</tr>
</table>
</body>


as you can see, i've tried centering by both setting 'vertical-align: middle;' in the style, and by creating a table with a single cell that alligns centrally. I had no luck with the style at all. The table seems to work in dreamweaver, but not ie. any ideas?

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
why use style sheets???

<table width=&quot;100%&quot; height=&quot;100%&quot;>
<tr>
<td valign=&quot;middle&quot; align=&quot;center&quot;>
CENTER
</td>
</tr>
</table>

Known is handfull, Unknown is worldfull
 
1) it didn't work as a table, i had to try somehting else
2) dreamweaver throws style sheets around like they're going out of fashion.

any more ideas?

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
did u try my code? i have done this once in a project...

Known is handfull, Unknown is worldfull
 
yes, code tried. looked nice in dreamweaver, not so nice in ie.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
meaning? the word &quot;CENTER&quot; is not in the center?

can u give me a link for that page???

Known is handfull, Unknown is worldfull
 

- it's at the top of the screen at my end. how is it for you?

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
bang in the center.


i am using IE 5.5...

Known is handfull, Unknown is worldfull
 
it's at the top on my machine, and at the top on my 98 machine (also ie 6). BUT, it's in the middle on the admin machines - ie 5.something. i think i've uncovered something bigger than the both of us.

thanks for our help. i don't really know what to do next. perhaps i should contact microsoft. i'll probably just ognor it and get on with my life.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
Remove the first line of your code:

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd&quot;>[/URL]

And it does what you expect (in IE 6 for me at least).

Jeff
 
thanks jeff.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
Vragabond...

The solution I proposed (removing the doctype) *does* work to solve the problem as stated in the browser (IE6) that seanbo was using (no might about it).

Often problems occur when you include a doctype without understanding what it actually does -- or when you begin testing a solution with browsers that react to specific doctype definitions.

The link you posted is an excellent article... and I recommend reading it (if you have managed to make it this far down the post).

Omitting the doctype will enable &quot;quirks mode&quot; and the browser will attempt to parse your page in backward–compatible fashion (from the article mentioned above). This is not necessarily a bad thing... it depends on the target browser audience.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top