Reputation: 5528
I need to place a couple squares side by side using this HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
.block{
height:20px;
width:20px;
background-color:blue;
float:left;
margin-right:3px;
}
</style>
</head>
<body>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
</body>
</html>
but I am using one application named Corda to generate PDF out of the HTML,which does not support the css float property. Are there any other ways to achieve the same effect using other css properties? (Corda has only basic css tag support)
Upvotes: 0
Views: 3077
Reputation: 174957
display: inline-block;
/* Or */
display: table-cell;
are your best options. unfortunately, lower IEs won't like both.
Upvotes: 0
Reputation: 1595
You can use display:inline to get them next to one another. display:inline-block will cause them to behave more like a standard <div>
but its not supposed by ie7 or lower.
Upvotes: 3