I am really facing some strange problem. Here is sample code and sample code code
HTML
<div id="showCatagory_<?php echo $row['catagory_id']; ?>" class="left" style="display:block">
<?php echo $value; ?>
</div>
CSS
.left { float:left }
When I use this one <div id="showCatagory_<?php echo $row['catagory_id']; ?>" class="left" style="display:block">, I get a snapshot that is wrong

And if I use <div class="left" id="showCatagory_<?php echo $row['catagory_id']; ?>" style="display:block">, then I get the correct alignment, which is in the following figure
here i put class="left"after id to do it right. Can anyone tell me why

Can someone tell me why
<div class="left" id="showCatagory_<?php echo $row['catagory_id']; ?>" class="left" style="display:block">
differs from
<div id="showCatagory_<?php echo $row['catagory_id']; ?>" class="left" style="display:block">
source
share