I believe the reason for the misalignment as well as the purple outline of the search icon, is because the image is being given a link border (browser default). You could override this by adding this to the top of your CSS:
Code:
a img
{
border:none;
}
This will prevent any link-indication borders from being placed around images that are links. In addition to help clean things up a bit, I personally would:
1. Replace your current #searchicon{} CSS with this:
Code:
#searchicon
{
position:relative;
width:?px;
height:?px;
top:-59px;
left:65%;
background:url(Images/searchicon1.png);
}
2. Also in your CSS, add this under #searchicon{}:
Code:
#searchicon:hover
{
background:url(Images/searchicon2.png);
}
3. Remove the entire search icon <img> tag ( <img src="Images/searchicon1.png" onmouseover="this.src='Images/searchicon2.png';" onmouseout="this.src='Images/searchicon1.png';" id="searchicon"/> ), and replace it with:
Code:
<div id="searchicon">
Now your image will be the div's background image instead of being a loose image element. Personally I always prefer to place my images as background images like this, rather than using the <img> tags, whenever possible. Also in Step 1, you will need to replace the ?'s in the width and height properties with the image's width and height. Step 2 is a cleaner method for changing the image when being hovered. And with doing all that, you now only need the simple <div> tag shown in Step 3. Hope this helps!