How do I center an existing webpage.


J

Jen

On a web view the page looks indented to the left. How do i center the page
 
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 :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top