Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Height differences between ie and ff. 2

Status
Not open for further replies.

j4606

MIS
Nov 28, 2005
349
US
I have the following html/css that creates some divs with rounded corners. I can't figure out why IE appears differnt from opera ff safari and other browsers. Anyway I get the following to look like it does in ff for ie 6 or 7?

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
	<head>
		<style type="text/css" media="screen,print,projection">
			/**** CSS for blue boxes ****/
			#roundedBlueDiv {

			}
			/* Rules for the top corners and border */
			.round-top-blue{
				background:url([URL unfurl="true"]http://i31.tinypic.com/210eh6d.gif)[/URL] no-repeat 100% 0;
				margin:0 0 0 18px;
				height:5px;
			}
			.round-top-blue div{
				height:8px;
				width:18px;
				position:relative;
				left:-18px;
				background:url([URL unfurl="true"]http://i31.tinypic.com/210eh6d.gif)[/URL] no-repeat 0 0;
			}
			.round-bottom-blue {
				background:url([URL unfurl="true"]http://i31.tinypic.com/210eh6d.gif)[/URL] no-repeat 100% 100%;
				margin:0 0 0 18px;
				height:5px;
			}
			.round-bottom-blue div {
				height:5px;
				width:18px;
				position:relative;
				left:-18px;
				background:url([URL unfurl="true"]http://i31.tinypic.com/210eh6d.gif)[/URL] no-repeat 0 100%;
			}
			.round-content-blue {
				padding:0 0 0 12px;
				background-color:#5165a3;
				margin:0 4 0 4;
				text-align:left;
			}

			/**** CSS for grey boxes ****/
			================================================*/
			#roundedGreyDiv {

			}
			/* Rules for the top corners and border */
			.round-top-grey{
				background:url([URL unfurl="true"]http://i27.tinypic.com/35mmiqb.gif)[/URL] no-repeat 100% 0;
				margin:0 0 0 18px;
				padding:0px;
				height:2px;
			}
			.round-top-grey div {
				width:18px;
				height:5px;
				position:relative;
				left:-18px;
				background:url([URL unfurl="true"]http://i27.tinypic.com/35mmiqb.gif)[/URL] no-repeat 0 0;
			}
			.round-bottom-grey {
				background:url([URL unfurl="true"]http://i27.tinypic.com/35mmiqb.gif)[/URL] no-repeat 100% 100%;
				margin:0 0 0 18px;
				height:5px;
			}
			.round-bottom-grey div {
				height:5px;
				width:18px;
				position:relative;
				left:-18px;
				background:url([URL unfurl="true"]http://i27.tinypic.com/35mmiqb.gif)[/URL] no-repeat 0 100%;
			}
			.round-content-grey {
				padding:0 0 0 12px;
				background-color:#f1f0f0;
				margin:0 0 0 0;
			}
			/*** Unique page divs***/
			.searchBoxInput{
				background:transparent url(/Images/search-box-input-corner.gif) no-repeat scroll 0px;
				border:medium none;
				vertical-align:middle;
			}
			#SearchBoxBlue{
				width:250px;
				margin:0px auto;
			}
			#SearchGreyBoxWrap{
				margin:5px;
			}
		</style>
	</head>
	<body>
		<div id="container">
			<div id="SearchGreyBoxWrap">
				<div class="round-top-grey"><div></div></div>
					<div class="round-content-grey" align="center">
						<div id="SearchBoxBlue" align="left">
							<div class="round-top-blue"><div></div></div>
								<div class="round-content-blue">
									<span style="color:White;">Enter&nbsp;Your&nbsp;Model&nbsp;#</span>
								</div>
								<div class="round-bottom-blue"><div></div></div>
							</div>
						</div>
						<div class="round-bottom-grey"><div></div></div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
 
I noticed changing to xhtml strict fixes the problem but that is not an option atm. :(
 
Nnm problem fixed by switching from.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
>
to
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
VSS was auto inserting the doctype so i didn't double check it. :<
 
Is it really incomplete though I read that the DTD url was optional?
The complete doctype did fix the display differences between ie7 and other browsers except for ie6. IE6 is still being silly and adding exra padding or margin to my divs, I'm sure this bug is documented somewhere I guess I'll try some other solutions.
 
Try setting font to 0 for IE6 (in a separate stylesheet) for the elements that have no contents inside them. That's what usually IE6 keeps the space for.

Doctype without a URL is incomplete and will have the same effect as having no doctype at all.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Surely this is invalid CSS?

Code:
/**** CSS for grey boxes ****/
================================================*/

You're closing your comment block on the first line, but the second line has no opening comment... This would most likely cause a CSS parsing error with unpredictable results.

Try fixing this...

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Try setting font to 0 for IE6 (in a separate stylesheet) for the elements that have no contents inside them. That's what usually IE6 keeps the space for.

Awesome that fixed the display issue for ie6, thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top