...

View Full Version : I STILL want to know the reason why it worked.



effpeetee
12-02-2007, 03:27 PM
This program was modified by me to make it work on IE7 and FFox 2..
I have highlighted the code that I added to make it work. The trouble is that I don't know why it worked. I just messed about until it did. The result was OK but I learned nothing. Anybody that can, will they please explain why.

Frank.

Originally from. http://codingforums.com/showthread.php?t=128820

Can be found on my site at-

http://www.exitfegs.co.uk/Box%20test.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Box test</title>
<style type="text/css">



.headline_bg {
clear:both;
float:left;
background: #E8EFF6;
width:440px;
height:40px;
}

.dotted {clear:both;
position:relative;
float:left;
background: #ccc;
width:440px;
height:20px;
}

.datebox {
position:absolute;
display:inline;
background: #ff00CC;
margin-left:7px;
width:53px;
height:60px;
}

.clear {
clear:left;
}
</style>
</head>

<body>
<br />
<br />
<p>Make this</p>
<div class="headline_bg"></div>
<div class="dotted"></div>
<div class="datebox"></div>
<br class="clear"/>
<p>Like this...</p>
<img src="im.jpg">


</body>
</html>

coothead
12-02-2007, 05:30 PM
Hi there Frank,

I do not know why your method works, all I know is that I would not do it like that. ;)

This is How I would approach the problem...

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Box test</title>
<base href="http://www.exitfegs.co.uk/">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
#make {
margin-top:60px;
}
#headline_bg {
float:left;
background-color:#E8EFF6;
width:440px;
height:40px;
}
#dotted {
clear:both;
float:left;
background-color:#ccc;
width:440px;
height:20px;
}
#datebox {
background-color:#f0c;
margin-left:447px;
width:53px;
height:60px;
}
</style>

</head>
<body>

<p class="make">Make this</p>

<div class="headline_bg"></div>
<div class="dotted"></div>
<div class="datebox"></div>

<p>Like this...</p>

<div><img src="im.jpg" alt=""></div>

</body>
</html>

coothead

effpeetee
12-02-2007, 06:23 PM
Hi!

Yes, I probably would have done it differently, but one or two others had already given the original poster advice and I was just messing about with CSVista to see if I could find out what worked, and the result on my site was the outcome. I just don't know why it worked. Why did FFox not like the original which worked fine on IE, and what did the fresh code do that made the difference.
My CSS is very basic, I have always done everything in the past with Markup.
But I am inquisitive and don't like working blind. Still, until we get some reliable and consistent browsers; we shall get these problems I suppose.

Thanks for the code. I will study it and hopefully learn from it.

EDIT, I have tried the code but I cannot get it to work.
It shows the im.jpg but not the div product.
Regards,

Frank

Excavator
12-02-2007, 06:42 PM
And, as usual, the answer is very simple and right in front of you. Good job coothead :thumbsup:

effpeetee
12-02-2007, 07:36 PM
I've got a first "class" IDea.

(My eyesight is not very good.)

Frank


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Box test</title>
<base href="http://www.exitfegs.co.uk/">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
#make {
margin-top:60px;
}
#headline_bg {
float:left;
background-color:#E8EFF6;
width:440px;
height:40px;
}
#dotted {
clear:both;
float:left;
background-color:#ccc;
width:440px;
height:20px;
}
#datebox {
background-color:#f0c;
margin-left:447px;
width:53px;
height:60px;
}
</style>

</head>
<body>

<p id="make">Make this</p>

<div id="headline_bg"></div>
<div id="dotted"></div>
<div id="datebox"></div>

<p>Like this...</p>

<div><img src="im.jpg" alt="Where has it gone?"></div>

</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum