954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How Do I Center HTML Page

DSLKeper
Newbie Poster
19 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

It is a problem in Opera browser where align attribute don't work, instead you can use tag which can solve the problem of centering.

<center><TABLE align="center" class="" style="BACKGROUND-IMAGE: url(http://www.directsellinglive.com/Rumors/Rumors.jpg)" height="1067" width="1916"></center>
rv1990
Junior Poster in Training
51 posts since Aug 2011
Reputation Points: 17
Solved Threads: 7
 

Thanks! I'll give it a try.

DSLKeper
Newbie Poster
19 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 
DSLKeper
Newbie Poster
19 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

Both

<center>


and

align="center"


have been depreciated in the newer html versions.
Go with :

<table style="margin:0 auto; text-align:center;"

It's valid to html5.

Okay - posted then saw the reply. What you have is a background graphic in a table. Add

; background-repeat:no-repeat; background-position:top center


after the background-image in the table style. However, fixing the table height and width will keep the table from shrinking and expanding. Go with percentages with a fixed min-width like:

<table style="margin:0 auto; text-align:center; width:100%; min-width:800px; background-image: url(http://www.directsellinglive.com/Rumors/Rumors.jpg); background-repeat:no-repeat; background-position:top center"


OR take the background graphic out of the table and make it the background of the body.

Dandello
Posting Whiz in Training
263 posts since May 2010
Reputation Points: 28
Solved Threads: 23
 
DSLKeper
Newbie Poster
19 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Direct Selling Rumors & Gossip</title>
</head>
<body style="background-color:#066082">
<table style="margin:0 auto; text-align:center; width:100%; min-width:800px; background-image: url(http://www.directsellinglive.com/Rumors/Rumors.jpg); background-repeat:no-repeat; background-position:top center">
<TBODY>
<TR><td>


</TD></TR></TBODY></TABLE>
</body>
</html>


or

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Direct Selling Rumors &mp; Gossip</title>
</head>
<body style="background:#066082 url(http://www.directsellinglive.com/Rumors/Rumors.jpg); background-repeat:no-repeat; background-position:top center;">
<table style="margin:0 auto; text-align:center; width:100%; min-width:800px;">
<TBODY>
<TR><td>


</TD></TR></TBODY></TABLE>
</body>
</html>


One of these should get you close.

Dandello
Posting Whiz in Training
263 posts since May 2010
Reputation Points: 28
Solved Threads: 23
 

You all have been fantastic! I am glad I found this community.

DSLKeper
Newbie Poster
19 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: