tags:

views:

289

answers:

5
+1  A: 

one technique is to do

    <img src="/Content/Images/Reports_white.png"
    /><img src="/Content/Images/Audit_white.png"
    /><img src="/Content/Images/Messages_white.png"
    /><img src="/Content/Images/Admin_white.png"/>
Jonathan Fingland
+1  A: 

Since you will probably want the tabs to be clickable you will need to add some elements DIV for example around the images. Make sure those elements have no margins and you can have whitespace inbetween the divs in the source no problem.

    <div><img src="/Content/Images/Reports_white.png"/></div>
    <div><img src="/Content/Images/Audit_white.png"/></div>
    <div><img src="/Content/Images/Messages_white.png"/></div>
    <div><img src="/Content/Images/Admin_white.png"/></div>
CtlAltDel
why would the images not be clickable? a div tag is not an anchor... if using javascript events, the image tag can raise those events just as well as a div.
Jonathan Fingland
I used the div as an example. Charlie's answer is more elaborate.
CtlAltDel
A: 

Any space between tags, e.g. a new line, are interpreted as white space. This only really affects inline elements, which <img> elements are so hence your problem.

You could also try adding float: left to the elements which will stack them horizontally without any spacing. Presumably you're actually implementing these as hyperlinks, we'd have to see the exact markup to suggest a specific solution for it.

roryf
A: 

Short answer: Remove the spaces between the img tags and make sure they have no margins.

If you don't want to bother about having spaces in the HTML, take some time to make them float:left, contained in a div (overflow:hidden will get its height correct).

streetpc
+6  A: 

I'd contain your tab images in an unordered list like this:

CSS:

ul.tabs
{
list-style:none;
padding:0px;
margin:0px;
}

ul.tabs li
{
padding:0px;
margin:0px;
float:left;
}

HTML:

<ul class="tabs">
<li><img src="/Content/Images/Reports_white.png"/></li>
<li><img src="/Content/Images/Audit_white.png"/></li>
<li><img src="/Content/Images/Messages_white.png"/></li>
<li><img src="/Content/Images/Admin_white.png"/></li>
</ul>

That way you can control the spacing using padding or margin.

Charlie