Archived

This topic is now archived and is closed to further replies.

  • 0

Boxes Title Links to specific sections on a different page


Question

Posted · Report post

I have three Boxes on my home page — each one is a specific service. I'd like to have each of the Box Titles take me to the same page but different sections in the content marked with <h3> headings.

 

How would I write the code and where?

Share this post


Link to post
Share on other sites

1 answer to this question

Posted · Report post

Hi,

 

If there is an <a name="part1"> tag or any tag with an id (e.g., <div id="part1">), then you can simply append #foo to the URL. Otherwise, you can't arbitrarily link to portions of a page.  Just be very careful that the id is unique, and one you custom created or the link will not work properly.

Here's a complete example: <a href="http://example.com/page.php#part1">Jump to #part1 on page.php</a>  This isn't a section specific thing, but a matter of including the correct identifying tag in the section, at the beginning of any content within it.  It doesn't work on H3 alone (and you don't want it to) but, if could work with <h3 id="part1">.

 

I should advise that having too many H# tags in a page can have a minor adverse affect on SEO.  Thus my recommendation would be to use <div id="part1"> instead. Just make sure to remember to close the tag with </div> at the end of your content.

Share this post


Link to post
Share on other sites