I have a problem with CSS that I do not understand. The h2
tag is appended to the previous element, rather than being on a seporate line.
My code makes use of the CSS properties position
, float
and clear
. Perhaps the problem is something to do with that?
I have tried to disabling various CSS styles in Chrome developer without luck.
Here is my minified code example:
div {
width: 100px;
float: left;
}
label {
position: relative;
left: 30px;
}
input[type="radio"] {
position: absolute;
}
<section>
<div>
<input type="radio">
<label>Radio #1</label>
</div>
<div>
<input type="radio">
<label>Radio #2</label>
</div>
<div>
<input type="radio">
<label>Radio #3</label>
</div>
</section>
<h2>Heading</h2>