I am attempting to float a span to the right within an h2 element. In IE8 and Firefox this works fine; in IE7 it is not floating.
The HTML:
<h2>
<span id="spanA"> /*Should be floated to the right*/
<span id="spanB">
<span id="spanC">
</h2>
The CSS:
#spanA{
float: right;
}
Any ideas as to what could be wrong?
The span tag is an inline element not a block level element. Thus it doesn’t float when rendered according to specification. Have you tried adding display:block; to the css for #spanA ?