Jump to content
Larry Ullman's Book Forums

Anchor Point Hyperlink Example?


KeepLearning
 Share

Recommended Posts

It's very good use IDs in longs texts. Think law data, etc. That way, you can link directly to a heading (or other element) in the middle of a web page.

 

Where you call the method:

// inside a class
$param = array("#" => "law-4.2")

$this->someMethod($param); // Might have other params...

 

And in a view file:

<!-- Creating a heading with an anchorID -->
<h2 id="law-4.2">§ 4.2 - Important law</h2>

 

Where the URL would look something like:

http://domain.com/controllerID/actionID/#law-4.2

Link to comment
Share on other sites

Antonio: I'm not familiar with your html syntax. 

 

I've always done it this way:

 

 

<p><a href="#Arrive here">Click here</a></p>
<p> </p>
<p><a name="Arrive here">Arrive here</a></p>
 
My way does not involve any id, which is why I did not understand the term "anchorid".
 
I am puzzled that we are creating anchor points differently. What do you think?
 
Thanks.
Link to comment
Share on other sites

This is a totally minor point, but it's more conventional to use IDs for anchors these days. In part this is because IDs are often being used for other reasons already and using "a name=" has no meaning except as an anchor.

Link to comment
Share on other sites

 Share

×
×
  • Create New...