What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Centering my website on the screen with HTML code help


Messages
11
Likes
1
I made my website on my laptop with a pretty small screen. I just opened it up on a much wider screen and it's awkwardly shifted over on the left hand side. I want it so that the site itself is centered, but not necessarily the text, pictures, ect. The page has tables on it for organizational purposes. I've been looking all over Google for help, but every HTML code I've found hasn't helped. Any suggestions?
 
Just add this to the top and bottom of the main html body.

<table><center>

</center></table>

Let me know how it works out for you. Also posting the html doc would be helpful too.
 
This needs to be done using Div Tags and CSS.

Layout using tables is not done much now a days although this is another option but seen as tables for tabular data , not layout.

Depending on what your site is in most cases the whole site is wrapped within a container using div tags and css for alignment .

You can make the site width with a pixel or percentage rate fixed or fluid.

As long as the wrapper/container for your site is set to center align it will or should show this in the browser.
 
The post above this one is only particular right. Simply wrap your whole markup in a div with a class like "wrapper". Then in you CSS simply put .wrapper { margin: 0 auto; width: YOURLAYOUTWIDTH; }. "YOURLAYOUTWIDTH" has of course to be replaced with the width of your layout in px.
 
infomatrix... not sure what your asking .

The above css and html is for a site i am making, at this stage everything is centered and contain within a wrapper/container in css and html div tags.

You can use css and html to place images where ever you want them to appear on your site. it can get a bit complicated sometimes with different areas where you use images if you want them to partly overlay over another image, but again Like a said above i am no coder and you should consult one or ask in this forum if you want to know something specific .

Most of the sites i do are for friends who want something fairly basic. anything advance is done by another friend of mine . I just do the basic layout of the over all site.

Most things are through css3/html and html5, and div tags when it comes to layout...

You can position something, make it look how you want , the typography you want, what happens to something on a rollover image, padding, what color and so much more just through css3.

Check it out on the net and might find what your asking.
 
yeah i was asking if your above method could be used in a more loosely, general way, and be used to center not just pages but other things like images , text and stuff...but i see its there would be more specific, better designated options for thinks like that...thank you though...
 
Yes you can...

You can place div tags within div tags.

So 1 div would be your wrapper/container with a start and end div tag.

Within this set of divs you can place other div tags for anything you want including images. You then target ( for want of a better word ) the div with the CSS3 and make it appear where you want. just remember that any padding etc you did for the wrapper/container css will affect how you images would be placed.

CSS3 is really good and fairly moderate to learn depending on your learning curve that is, but once you get the hang of it it's plain sailing.

Check out on the net. would recd you try this site. http://www.w3schools.com/
 

Back
Top