Not only the selected HREF gets surrounded, but the whole row gets surrounded

S

Stefan Mueller

Because in Internet Explorer I always have a small space after a HREF I use
'style = "display:block"'
<a href = "mailto:[email protected]" style = "display:block">[email protected]</a>
That works fine.

However if I select the HREF with the Tab key not only '(e-mail address removed)' gets
surrounded. The whole line gets surrounded.

Here an example:
<table width = "100%">
<tr>
<td align = "center">
<a href = "mailto:[email protected]" style =
"display:block">[email protected]</a>
</td>
</tr>
</table>

If I don't use 'style = "display:block"' only '(e-mail address removed)' gets
surrounded. That's what I'd like to have.

Is it possible to avoid the space after a HREF so that still only
'(e-mail address removed)' gets surrounded if it gets seleced by the Tab key?
Stefan
 
J

Jonathan N. Little

Stefan said:
Because in Internet Explorer I always have a small space after a HREF I use
'style = "display:block"'
<a href = "mailto:[email protected]" style = "display:block">[email protected]</a>
That works fine.

However if I select the HREF with the Tab key not only '(e-mail address removed)' gets
surrounded. The whole line gets surrounded.

The 'small space' your see is the whitespace in your markup. Browsers
are supposed to ignore but IE doesn't to fix put the closing TD tag
immediately after the closing A tag

<table>
<tr>
<td><a href="somewhere.html">To Somewhere</a></td>
</tr>
Here an example:
<table width = "100%">
^^^^^^^^^^^^^^
put in your stylesheet not your markup
<tr>
<td align = "center">
^^^^^^^^^^^^^^^
put in your stylesheet not your markup
<a href = "mailto:[email protected]" style =
"display:block">[email protected]</a>
</td>
</tr>
</table>

If I don't use 'style = "display:block"' only '(e-mail address removed)' gets
surrounded. That's what I'd like to have.

Is it possible to avoid the space after a HREF so that still only
'(e-mail address removed)' gets surrounded if it gets seleced by the Tab key?
 
R

Rik

Stefan said:
Because in Internet Explorer I always have a small space after a HREF
I use 'style = "display:block"'
<a href = "mailto:[email protected]" style =
"display:block">[email protected]</a> That works fine.

What do you mean by "small space"?
Making it a block hardly seems the answer. What is it exactly you're trying
to do? If you're only interested in some space after the link, why not use
margins or padding? That's what they're for.
However if I select the HREF with the Tab key not only
'(e-mail address removed)' gets surrounded. The whole line gets surrounded.

Yep, making it a block will do that. The <a> takes up the whole line.

Grtz,
 
S

Stefan Mueller

Many thanks to all.
To write everything on one line really solves my problem.

Stefan
 
S

Steven Saunderson

Many thanks to all.
To write everything on one line really solves my problem.

Yes, one line can help but the important thing is to avoid white space
between > and <. This is why I put > on the following line immediately
before the next <. I hated this formatting at first but now it seems
fine in cases when it produces a better result.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top