Pennimus
07-18-2005, 11:53 PM
In linking to name anchor tags throughout long pages I've noticed that following the link leads to a rather abrubt cutoff of the linked to text.
For an example, please visit this link on a skateboarding website (http://www.board-crazy.co.uk/tricks_f.php#feeble). Notice how the link takes you to the '#feeble' name anchor but that the actual 'Feeble Grind' text appears too close to the top of the browser.
This could of course be solved by making the anchor wrap around a <p> </p> above the actual text, but this is a last resort for me as I'd rather not clog up my code with otherwise functionless paragraphs or divs (not to mention there are several hundred of these anchors to modify).
Instead, I'm wondering if there is a CSS workaround? All my name anchors are H2 tags anyway, so a simple style element would be ideal. My H2 tags currently have 15 pixel padding-top which works great for layout but unfortunately the padding isn't recognised by the browser when linking directly to the name anchor. Margin-top has a similar effect (or lack of, as the case may be).
Anyone know of a way I could drop a few pixels in there that might affect the anchor as well as the layout?
EDIT : Just checked in IE and this is not an issue there - either Internet Explorer recognises the padding or it always puts a gap above name anchors when linked to anyway. Firefox is the problem.
Regards,
Pennimus.
For an example, please visit this link on a skateboarding website (http://www.board-crazy.co.uk/tricks_f.php#feeble). Notice how the link takes you to the '#feeble' name anchor but that the actual 'Feeble Grind' text appears too close to the top of the browser.
This could of course be solved by making the anchor wrap around a <p> </p> above the actual text, but this is a last resort for me as I'd rather not clog up my code with otherwise functionless paragraphs or divs (not to mention there are several hundred of these anchors to modify).
Instead, I'm wondering if there is a CSS workaround? All my name anchors are H2 tags anyway, so a simple style element would be ideal. My H2 tags currently have 15 pixel padding-top which works great for layout but unfortunately the padding isn't recognised by the browser when linking directly to the name anchor. Margin-top has a similar effect (or lack of, as the case may be).
Anyone know of a way I could drop a few pixels in there that might affect the anchor as well as the layout?
EDIT : Just checked in IE and this is not an issue there - either Internet Explorer recognises the padding or it always puts a gap above name anchors when linked to anyway. Firefox is the problem.
Regards,
Pennimus.