align my aspx page in the middle

A

ALI-R

How do I allign all my content in aspx page in the middle of page like a lot
of websites ?

Dose it work with differnet screen resolutions?

Thanks for your help.
 
K

Ken Dopierala Jr.

Hi,

Put everything inside a <p> tag:

<body...>
<form....>
<p align="center">
*Put all of your HTML here.
</p>
</form>
</body>

Good luck! Ken.
 
P

Peter Rilling

There are a couple HTML ways of doing it.

1) Use the <center/> element.
2) Use tables and define the alignment as being centered.

There are probably others but this is really just an HTML issue.
 
M

Matt Berther

Hello Ken,

<p> stands for paragraph. Clearly you meant <div>, which is a section of
content.
 
K

Ken Dopierala Jr.

Hi Matt,

Nope, I mean paragraph. Set the alignment to center and everything inside
will be centered on the page. <div> will work too. <center> will make it
work. Alternatively you can set the "style" attribute of many parent
controls to center themselves on the page which will in turn center what is
inside. Then you can use the "align" attribute of the children controls to
organize them inside the parent. There a lot of ways to do this. The nice
thing about <p> is that you also have a "justify" option instead of just
left, center, and right align. Ken.
 
A

ALI-R

What dose "justify" option dose ,I used justify along with "<P>" ,it dosn't
center the page,but with "Center",it is exactly what I want.
Thanks to all of you for helping.
ALi
 
M

Matt Berther

Hello Ken,

My whole point was that the <p> tag is not the correct choice. <p> stands
for paragraph and as such should be used for paragraphs of text, not nested
forms or other things like that.

A container tag like <div> is the right choice for this. Although, for that
matter, you could use <body align='center'> too.

The reason why the other tags dont have a "justify" option is because its
hard to "justify" a form or an image...
 
K

Ken Dopierala Jr.

Hey Matt,

There are a ton of ways to do it. <p> will work just fine. Nobody has
talked about nested forms and in an ASP.Net newsgroup you'll never see them
recommended. Ken.
 
K

Ken Dopierala Jr.

Hi ALi,

When you use "justify" with text inside the <p> tags the text will stretch
itself so that it is both left and right aligned. Meaning that each line,
even though they don't contain the same amout of text will be sized to be
exactly the same width. Ken.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top