I'm struggling to place two identical divs side by side on the same row, covering the entire width with some space between them. However, using margin impacts both divs due to their shared class, causing the second div to drop below. I've attempted solutions like overflow:hidden and adjusting size, but nothing works. Adding borders with overflow hidden also doesn't resolve the issue.
The only workaround is to create multiple divs with the same class, despite needing them to span the full width of the row.
Edit: Here's a simplified example of my dilemma:
<div class="container">
<div class="block">content...</div>
<div class="block">content...</div>
</div>
<style>
.container{width:1000px; margin:0px auto;}
.block{width:480px;height:500px;float:left;}
</style>
I aim to position the first block followed by a 40px gap, then the second block.