How to Add Spaces Using Div in Html
I Want to Add Spaces Between Two Widgets. Please Tell Me an Inline Div Code to Add a Space of Around 300Px. I Have Used This Code: but I Couldn't See 300Px Gap...
I want to add spaces between two widgets. Please tell me an inline div code to add a space of around 300px. I have used this code:
<div style="width:300px"></div>
but I couldn't see 300px gap between the two widgets.
How to add this much gap between those widgets?
2 Answers
Check this example , if you are keeping the div empty you need to give it a height than only it will occupy the space .
.div1{width:200px;background:#ddd;height:200px;display:inline-block}
.div2{width:200px;background:red;height:200px;display:inline-block}
.gap{width:200px;background:none;height:200px;display:inline-block;}
<div class='div1'></div><div class='gap'></div><div class='div2'></div>
edit: removed solution that had already been tried but was not yet in the question
Pure HTML:
<div></div>
Note that represents a single space, so keep adding them until you have enough. Note that this is an extremely crude and not-recommended solution. For a pure CSS solution, see the demo.
edit: here is a demo