Centering a MasterPage in a browswer window using Visual Web Developer 2005

P

Paolo

I would like to have it so that my webpages, which are built using
MasterPages, always appear in the center of the browser of the user, even if
he resizes the browser window. As a starting point, when creating the
Masterpage, this is the generated html:
<body>

<form id="form1" runat="server">

<div>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>

</form>

</body>



How do I modify it so that if I use a table that has a border for the site,
the table always is centered in the browser window?



TIA
 
C

clintonG

If you like looking at red squiggles underlining all of the deprecated
attributes and getting XHTML warning Tooltips while your in the Visual
Studio IDE by all means use deprecated attributes.

I think its better to use CSS -- as well as tables where pragmatic -- but
learning to use what and where when developing ASP.NET is just another
learning curve.

Max Design offers a number of sample CSS layouts [1]. I integrate HTML
tables into CSS layouts as needed.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://www.maxdesign.com.au/presentation/page_layouts/index.cfm
 
C

Cor Ligthert [MVP]

Paolo,

I assume you mean horizontal centering, vertical is in opinion almost
impossible.

There is on Internet javascript that can measure the sides (be aware that
you need two versions of browser types for that, for IE is often another one
needed than for Netscape derived ones).

In my opinion is a better way not to use the pixel as measuring however to
do everything in % in CSS or whatever.

I hope this helps,

Cor
 

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