Some HTML Help Please?

Kraze_T

New Member
Messages
355
Reaction score
0
Points
0
Hi, i have recently created a website and i have noticed the site is not centered :( how can i center the site for all screens? is there any code?
 
F

Fahad

Guest
Enclose the whole site within <center></center> tags.
I have used this before, but never with a whole site!
 

dotaloc

New Member
Messages
22
Reaction score
0
Points
0
i guess there are a few options according to what you are trying to accomplish.

you may need to put everything in a centered div. if you are not familiar with divs, you should read up on them.

the following link shows another way:

http://bluerobot.com/web/css/center1.html

link to your page and someone may can help further or more specifically.
 

torrey

New Member
Messages
9
Reaction score
0
Points
0
What are you trying to accomplish? A centered div will center everything but it will also center text and images which could change the way your site looks. Are you trying to get the content in the middle of the screen with margins on either side? YOu may be needing to set parameters in a table or CSS code for that
 

nabil

New Member
Messages
39
Reaction score
0
Points
0
Hello,
Use CSS properties to center your pages, it would be better :)

~Nabil
 

Kraze_T

New Member
Messages
355
Reaction score
0
Points
0
i want it so when someone goes on the website, no matter what size screen they have, the site is always centered.

I hope that explains it better
 

BorderLineSigs

New Member
Messages
232
Reaction score
0
Points
0
i would say do this <center><body>hsdlgjkhjdshglkdh(what ever the body is)</body></center> hope it helped ya
 
Last edited:

Jake

Developer
Contributors
Messages
4,057
Reaction score
5
Points
0
do

<div align="center"> content </div>

I am not sure if it is "correct" html but it works and it is what dreamweaver automatically does if you use its centering button.

edit: is there a link to what you want centered? so we can help you better?
 
Last edited:

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
Here is another example that uses css, and only centres a div not all the contents as well, examples of this include this forum itself, it centres the div with a background around it, but not the contents. It uses the margin css properties.

HTML:
<head>
<style  type="text/css">
.maindiv
{
    margin-top: 0px;
    margin-right: auto;
    margin-left: auto;
}
</style>
</head>
<body>
    <div class="maindiv" style="width: 85%;">
        Here is the Uncentered Content within a centered div.
    </div>
</body>
 

Jake

Developer
Contributors
Messages
4,057
Reaction score
5
Points
0
u could also use

margin: 0px auto;
 

shaunak

New Member
Messages
320
Reaction score
0
Points
0
Use css properties... the center tag is depriciated....

Code:
#box{
width: 80%;
margin: auto;
}
and in the html:
Code:
<div id="box">
your html here...
</div>
 
Top