- About
- Expression Web Forum
- Expression web resources
- CSS
- Build Expression Web Template 1
- Build Expression Web template 2
- Build Expression Web Template 3
- Style horizontal Navigation with CSS
- Style vertical menu with CSS
- Style the main content area
- Style the footer
- Centre a page
- .style1
- Build Expression Web DWT Tutorial
- Graphic Template example
- Free Expression Web Templates
- Add RSS to Expression Web
- Expression web forms
- Contact
- RSS feeds
- 10 Tips
- Page includes
- Insert flash in expression web
- Expression web dropdown menu
- Use XML with Expression Web
- Point and click easy drop-down menu's
- Table Based Layouts
- ASP.NET Ad Rotator
- Display Data
- Search database using a text box
- Transparent Text
- Bold text - Formatting
- Date and time
- Who are you
Centring pages in the browser.
If you want to web site to be a fixed width, you will most likely want to have the web site in the centre of the browser, when viewed in a larger browser view port.
Layers or divs?
A layer, is an absolutely positioned div. Position is taken from the top left of the browser window. You will never get a layer made site to centre in a browser window!
<div>'s require you to tell them what to do via your styles and can be centred in a browser window.
Copy and paste the codes below.
CSS
<style type="text/css">
<!--
body { text-align:center; }
#container { text-align:left; width:760px; margin:0 auto;position:relative;
background-color: #CCCCCC;
}
-->
</style>
XHTML
<body>
<div id="container">
<p>this is content<br />
And some more content</p>
<p>and just some more</p>
</div>
</body>
An example of the above code in action can be seen here.
The container div holds your other divs that make up the layout of your site.
RSS
Our forum feed can be found here
Reader not listed? Click here for more options
Expression Web Help RSS
Expression Web Help. Tips and Tricks and tutorials Get our feed now
