Erik Sommer Erik Sommer - 1 month ago 5
HTML Question

How to wrap a block around a div tag?

I want to wrap a block around some text and a table. My problem is that the second identical block moves into the first one with the id 1.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Test</title>
</head>
<body >
<div id="1">
<table cellpadding="4" style="font-size:400%; float:right; width: 250px; border:solid 1px #AAAAAA;">
<tbody>
<tr>
<th>Lorem</th>
</tr>
</tbody>
</table>
<div style="display:table; text-align:justify">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<div style="text-align: right;">[Lorem]</div>
</div>
</div>
<div style="width=100%">
<table cellpadding="4" style="font-size:400%; float:right; width: 250px; border:solid 1px #AAAAAA;">
<tbody>
<tr>
<th>Lorem</th>
</tr>
</tbody>
</table>
<div style="display:table; text-align:justify; text-indent:; padding-left:0; padding-right:0;">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<div style="text-align: right;">[Lorem]</div>
</div>
</div>
</body>
</html>


It looks like this: It looks like this.

It should look like this:It should look like this.

What have I add to the div tag with the id "1"?

Answer

Try it

<div style="background-color:#cccccc; overflow: auto;" class="clear_fix">

link:-How to correctly impose a background-color to a div wrapping article and aside in HTML/CSS?

Comments