Here is the markup:
<div class="test">
// These links are added with JavaScript
<a href="fijf">Text 1</a>
<a href="dfugru">Text 2</a>
</div>
<h1>
Here is my CSS:
a {
display: inline-block;
float: left;
// Other properties
}
.test {
display: block;
}
My problem is that the div
and heading appear side by side. However, I want the heading to appear below the div
.
I assumed that using display:block
will solve the issue but it doesn't.
I tried adding a <br>
tag after the div
but that does not work either.
One thing that works is setting a height on .test
. The problem with this is that some other users might set a higher font-size, hence,(rendering the height I set on container useless) for links somewhere else and this will mess up the layout.
EDIT:
I have just control over the div and the elements inside it. There can be anything above or below the div. The heading is just for reference.