Web Hosting Talk







View Full Version : CSS help


stuffradio
07-06-2007, 01:51 AM
I have a layout in CSS, whenever the window isn't full screen, the layout breaks. Any idea how I can fix this? The lines just mess up, etc.

Jay August
07-06-2007, 02:35 AM
dump all absolute positioned items, is my first response but I can't be sure without an online example.

stuffradio
07-06-2007, 02:41 AM
#container
{
width: 90%;
margin: 10px auto;
background-color: #fff;
color: #333;
border: 1px solid gray;
line-height: 130%;
}
#top
{
padding: .5em;
background-color: #ddd;
border-bottom: px solid gray;
}
#top h1
{
padding: 0;
margin: 0;
}
#leftnav
{
float: left;
width: 160px;
margin: 0;
padding: 1em;
}

#content
{
margin-left: 200px;
border-left: 1px solid gray;
padding: 1em;
height: 500px;
}
#link
{
color: #4169E1;
text-decoration: none;
}
#footer
{
clear: both;
margin: 0;
padding: .5em;
color: #333;
background-color: #ddd;
border-top: 1px solid gray;
}

#leftnav p { margin: 0 0 1em 0; }
#content h2 { margin: 0 0 .5em 0; }
#content { max-width: 36em; }

killapix
07-06-2007, 02:40 PM
May we see a link..? To more understand what may be wrong

Jay August
07-06-2007, 03:00 PM
Indeed, what killapix says... An online example explains it all. The HTML source is fine as well.

stuffradio
07-06-2007, 06:32 PM
Here it is,
http://wuensche.ca/psm/index.php?page=home

killapix
07-06-2007, 11:51 PM
The only thing I can see happening is the #top div follows the screen width, so you would need to set a width for that in css i.e. 100% also the same for footer div...and do away with the <center> tag and use css to center that text (text-align: center) ...:)

smqt
07-08-2007, 10:18 PM
Also, try to work from valid HTML.

Quick look:
- Using different doctypes results in different interpretations of some code (assuming you didn't purposefully leave it out);
- Title should be in the head;
- Link to external CSS is closed incorrectly;
- Multiple use of one ID;

http://validator.w3.org/

The use of an absolute value for your table-width clashes with the use of a percentage-width in your container.
Resulting in text running out of the div.
At least in some browsers.
Try not to use tables and move width and other measurements to your CSS.