The clear property cancels the effects of the float property, and can prevent wrapping from taking place.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>clear</title>
<style type='text/css'>
img#left {
float: left;
}
img#right {
float: right;
}
p {
clear: both;
margin: 20px 0 0 0;
font: 12px sans-serif;
border: 1px solid rgb(200, 200, 200);
background: rgb(244, 244, 244);
padding: 5px;
}
</style>
</head>
<body>
<img src='http://java2s.com/style/logo.png' alt='people' id='left' />
<img src='http://java2s.com/style/logo.png' alt='people' id='right' />
<p>
The clear property cancels the effects of the
float property, and can prevent wrapping from
taking place.
</p>
</body>
</html>
Related examples in the same category