Log in

View Full Version : Nubie with Huge html fiasco....



nubiepro
01-21-2006, 07:21 PM
My website was built to center within a large monitor. Isn't there html code I can use to center website within all monitors? Thank you in advance for any help out there. :D http://www.googlespage.com.

Twey
01-21-2006, 07:49 PM
The layout of that site is awful. You need to totally redesign it and use relative units such as % and em instead of the absolute units you have done there. In my browser (Firefox 1.5) at my resolution (1600x1200), not only is it not centred, but the paragraphs overlap.

nubiepro
01-21-2006, 08:05 PM
Thank you for taking the time to reply. Can you tell me more about that % and em? :)

Twey
01-21-2006, 08:44 PM
There are two types of units in CSS: absolute, and relative. An absolute unit would be something like px: it's the same size, no matter what size the window is. A relative unit is something like %: it is always a percentage of the size of the containing element, and changes in proportion if the user, say, resizes the window. Also available are em and ex for fonts, which mean the size of a capital letter M or X in the user's current font size, respectively. Good sites are built on the latter.

nubiepro
01-21-2006, 10:50 PM
Thank you! I'm using absolute and interested in 'relative'. If possible, can you compare a line of my absolute code to a line or two of 'relative code'? Thank you! :)

Twey
01-21-2006, 11:12 PM
Well, for example:
table#mytab {
margin-left: 20px; /* render 20 pixels away from the side of the page */
}Or:
table#mytab {
margin-left: 5%; /* render 5% of the way into the page (assuming table#mytab is a child of body) */
}

nubiepro
01-21-2006, 11:39 PM
Thank you so very much Twey!! :D