How do I center an existing webpage.


Ad

Advertisements

R

Ronx

1 - Give the page a full and valid !doctype
The !doctype code is the very first line in code view, and resembles:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
(all on one line)

2 - Wrap all the page content in a container with a fixed width.

3 - Use CSS to set left and right margins of this container to auto.

Example:

<div style="width: 760px; margin-left: auto; margin-right: auto;">
page content goes here
</div>

--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp/wf-menu.aspx



Jen submitted this idea :
 

Similar threads

M
  • Michelleassistsyou
  • Word
Replies
5
Views
646
abe999
A
M
Replies
0
Views
629
mas-671
M
L
Replies
1
Views
356
Don Schmidt
D
V
Replies
3
Views
163
Thomas A. Rowe
T
B
Replies
1
Views
454
macropod
macropod
J
Replies
3
Views
248
DavidF
D
J
Replies
1
Views
876
Ronx
R
J
  • JeffGeorge
  • Word
Replies
0
Views
392
JeffGeorge
J
Top