PDA

View Full Version : link displaying with extra space


burnjob
04-06-2005, 09:15 PM
I started with an HTML tutorial and put together a practice page and at the bottom of the page there are 3 links to other parts of the page (top, middle and paragraph 8)

The paragraph 8 link is displaying with an extra space between it and the link above it ... can someone explain to me how to fix this issue please?

I tried using different doctypes but there was no change.
Thanks


<br />
<a href="#top"><h3>Go To Top</h3</a>

<br />
<a href="#middle"><h3>Go To Middle</h3></a>

<br />
<a href="#para8"><h3>Go To Paragraph 8</h3></a>

</body>

</html>

incase it helps ... this is the doctype info:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


If someone would like the entire .htm document PM me and i'll send it.
Thanks

chilipie
04-06-2005, 09:21 PM
Try removing all the <br />s. Also, the <a> tags should be in the <h#> tags, not outside them :) .

burnjob
04-06-2005, 09:33 PM
removing the <br /> tag didn't change it ... then i tried moving the <a> tag like you suggested ... but i know i did something wrong cuz it is not a link any more

this is what i did:
<h3 a href="#top">Go To Top</a></h3>

obviously i am 'way' off the mark ...but i wasn't really sure what i was supposed to do with the <a> tag
thanks

burnjob
04-06-2005, 09:42 PM
Duhh!! ... ok ... i understand what you were saying (i think)

ok ... so this is what i have now:
<h3><a href="#top">Go To Top</a></h3>
<h3><a href="#middle">Go To Middle</a></h3>

is 'that' what you meant by 'inside'? (change the order)

i saved the change and refreshed the test page but the links still have a space between them ... but there's no <br> or <br /> tags there

weird !!
thanks

chilipie
04-06-2005, 09:48 PM
Yah, the second way is right ;) .

There will be a gap between <h#> tags, because they are block-level elements. You can adjust the padding/margins applied to them by the browser via CSS :) .

BTW, for what you are doing, I think you'd be better off with an unordered list; it seems more semantical [thanks to Ronald for that one :D ].

burnjob
04-06-2005, 09:51 PM
ok ... will try that
I tried taking away the <h> tags and the links were behaving themselves ... so i think i'll do it in a list like you suggested and just not display the disk in front of them
thanks