Right align icons in a header

A little curiousity I’ve found trying to put icons inside my headers. The order is significant (IE6/7 and FF2) such that to get the right effect I should put the images before the text. This is what I get if I do it ‘normally’…
Image icons in the header looking ugly


img.tool {
	float: right;
	cursor: pointer;
	display: inline;
	margin: 0px 2px 2px 0px;
}

<h1 class="position">
	Human Resources Administrator
	<img class="tool" src="img/new.png">
	<img class="tool" src="img/copy.png">
	<img class="tool" src="img/edit.png">
</h1>

Try as I might I just could not get the margin/padding/whatever to budge. But if I switch the images to be before the text I get the right result. Don’t bother to wonder why. Just make a mental note and keep moving.

Image icons in the header looking pretty


<h1 class="position">
	<img class="tool" src="img/new.png">
	<img class="tool" src="img/copy.png">
	<img class="tool" src="img/edit.png">
	Human Resources Administrator
</h1>
This entry was posted in geek and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>