help in centering page

PixelPusher

Super Moderator
Staff member
You site is centered, are you referring to one product item that isnt?

Also, the markup for you site is a mess, could be partly why you are having this problem. Looks like some type of auto-generated code.
 

bobby2

New Member
actually if you look at the bottom page where the body is it is be left aligned and I would like it to be centered
 

smoovo

New Member
Maybe I checked while you working on the page... :eek: But i can't see a centering problem, instead i see a product in the middle of the page floating right.
 

smoovo

New Member
Centering page with CSS

You should design your page wisely before inserting content. You have no sense in the structure. This is only the beginning. You have no stylesheet attached, your page points to your local machine instead. You have the same problem with your images.

Basically you need to tell the "body" or the "container" div, to align the content to the center. If you are using "container" div, tell it to take all the width and height.

Next, place you page content as a div, call it "page". Give it width to contain all of your content, let's say 900px. tell it to be flex, margin:auto will do the job. And to be more protected, text will be aligned to left.

example
HTML:
#container {
    width:100%;
    height:100%;
}

#page {
    width:900px;
    margin:auto;
    text-align:left;
}

and your page will look like this
HTML:
<div id="container">
    <div id="page">
        Your content...
    </div>
</div>

No offense, but try to be more clean. Your script should look clean and easy to access, for you and for the one that will follow you.

- Enjoy. :)
 

PixelPusher

Super Moderator
Staff member
Your paragraphs are too wide. Remove the width property from following styles:
Code:
.entirebodytag {
width:1010px;
}
body p {
width:1010px;
}

Use padding if you want to adjust your text. By default the paragraph element will expand to the full width of its parent.
 

orangecopper

New Member
start using Dreamweaver - you would not have to keep asking others and you can help your self. the GUI on the DM is excellent, all you have to do is select the table and from the properties tab select "center"

cheers
Josh
 

sitebuilder

New Member
<div style=" margin-left: auto ;
margin-right: auto ;"> everything in this div will be centered so long as this div width is smaller than the width of the div containing it </div>

And yeah always use dreamweaver if you can afford it, its got some learning curve but its definitely the best web design GUI
 

sitebuilder

New Member
<div style="margin-left: auto; margin-right: auto;"> This will set the left and right margins to auto adjust and equal each other, ie. center the div tag inside its surrounding area </div>

And yeah always use Dreamweaver if you can afford it, it's a great GUI
 

bobby2

New Member
PIXEL PUSHER YOU ROCK!! thats all i needed! Im sure i could use a lesson or 2 but for now all i needed to know was how to center the @#$% page haha thanks again...!

and orangecooper what is dm? sorry I am still a noobie web designer :)
 

PixelPusher

Super Moderator
Staff member
PIXEL PUSHER YOU ROCK!! thats all i needed! Im sure i could use a lesson or 2 but for now all i needed to know was how to center the @#$% page haha thanks again...!

and orangecooper what is dm? sorry I am still a noobie web designer :)

Thanks bud, glad I could help.
 
Top