Jump to content


CSS alignment off


3 replies to this topic

#1 Mr. Jay

    Young Padawan

  • Members
  • Pip
  • 81 posts

Posted 14 June 2007 - 03:24 AM

In Firefox & Opera it comes out perfect but in IE the alignment is different


index.html
<html>
	<head>
		<title>Test Layout</title>
		<style type="text/css" media="all">
			@import url(site_styles/css_01.css);
		</style>
	</head>
	<body>
		<div align="center">
			<div id="container">
				<div id="header">
					Header
				</div>
				<div id="guest">
					Guest
				</div>
				<div id="navigation">
					Navigation
				</div>
				<div id="content">
					Content
				</div>
				<div id="footer">
					Footer
				</div>
			</div>
		</div>
	</body>
</html>

css_01.css
* {
	margin: 0px;
	padding: 0px;
}
body {
	margin-top: 5px;
	background-color: #999999;
	font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif;
	font-size: 11px;
}
#container {
	width: 662px;
	min-height: 500px;
	max-height: 100%;
}
#header {
	text-align: left;
	border: #000000 solid 1px;
	margin-bottom: 5px;
	width: 660px;
	height: 100px;
	background-color: #990000;
}
#guest {
	padding: 2px 0 2px 0;
	text-align: center;
	border: #000000 solid 1px;
	margin-bottom: 5px;
	width: 660px;
	background-color: #990000;
}
#content {
	text-align: left;
	border: #000000 solid 1px;
	margin-bottom: 5px;
	margin-left: 5px;
	float: right;
	width: 500px;
	height: 300px;
	background-color: #990000;
}
#navigation {
	text-align: left;
	border: #000000 solid 1px;
	float: left;
	width: 150px;
	height: 300px;
	background-color: #990000;
}
#footer {
	text-align: center;
	padding: 2px 0 2px 0;
	border: #000000 solid 1px;
	clear: both;
	width: 660px;
	background-color: #990000;
}

On IE the Navigation & the Content is not perfect, any help fixing it?

Edited by Mr. Jay, 14 June 2007 - 03:28 AM.


#2 albinoAZN

    Albinos Are Extinct!!!

  • Members
  • PipPipPipPip
  • 1,139 posts
  • Gender:Male
  • Location:Mississippi, USA

Posted 14 June 2007 - 05:19 PM

I don't have IE to help you. Does anyone know of an online IE rendering engine? If you don't know what I'm talking about, here's one for safari for windows users.

http://www.browsrcamp.com/

#3 Mr. Jay

    Young Padawan

  • Members
  • Pip
  • 81 posts

Posted 15 June 2007 - 01:45 AM

Shows up perfect in that, but not in IE :o

#4 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 17 June 2007 - 03:58 PM

* {
    margin: 0px;
    padding: 0px;
}
body {
    margin-top: 5px;
    background-color: #999999;
    font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif;
    font-size: 11px;
}
#container {
    width: 662px;
    min-height: 500px;
    max-height: 100%;
}
#header {
    text-align: left;
    border: #000000 solid 1px;
    margin-bottom: 5px;
    width: 660px;
    height: 100px;
    background-color: #990000;
}
#guest {
    padding: 2px 0 2px 0;
    text-align: center;
    border: #000000 solid 1px;
    margin-bottom: 5px;
    width: 660px;
    background-color: #990000;
}
#content {
    text-align: left;
    border: #000000 solid 1px;
    margin-bottom: 5px;
    margin-left: 5px;
    float: left;
	width: 503px;
    _width: 506px;
    height: 300px;
    background-color: #990000;
}
#navigation {
    text-align: left;
    border: #000000 solid 1px;
    float: left;
    width: 150px;
    height: 300px;
    background-color: #990000;
}
#footer {
    text-align: center;
    padding: 2px 0 2px 0;
    border: #000000 solid 1px;
    clear: both;
    width: 660px;
    background-color: #990000;
}

It's them borders messing things up, as FF renders the borders on the inside of the div, IE renders them on the outside, around them. I believe this is fixed if you turn off quirks mode (set a doctype), but I'm not sure. For the time being, I'll just used the IE6 underscore hack to set a different width for IE.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users