I am using the example given in page 263 of the CSS Anthology by Rachel Andrew. I am trying to use the clear property to position a paragraph below a floated element. Unfortunately, it is not working for me. My paragraph is getting aligned next to the image when I view it it on my laptop in IE 6 as well as Firefox.
I am giving a code below. Unfortunately freewebs.com which I use is undergoing some maintenance today and I am not able to upload the example for you to see. Why is the example not working for me?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Float Image</title>
<style type="text/css">
.rightimg {
float: right;
margin-left: 20px;
margin-bottom: 6px;
}
clear {
clear: both;
}
p, ul {
border: 2px solid ~000000;
}
</style>
</head>
<body>
<h1>CSS Positioning and Layout</h1>
<img src="McNamaraPuneet.jpg" width="319" height="255" alt="Pooja and Priya" class="rightimg" />
<ul>
<li>List One</li>
<li>List Two</li>
<li>List Three</li>
<li>List Four</li>
<li>ListFive</li>
<li>List Six</li>
<li>List Seven</li>
<li>List Eight</li>
<li>List Nine</li>
</ul>
<p class="clear">I am trying to use the <B>CLEAR PROPERTY</b> to force this paragraph to be displayed below the floated element.I am trying to use the clear property to force this paragraph to be displayed below the floated element.I am trying to use the clear property to force this paragraph to be displayed below the floated element.I am trying to use the clear property to force this paragraph to be displayed below the floated element.</p>
</body>
</html>