Anchor ... #

S

shapper

Hello,

I have a menu using an unordered list.
Some of the items should not redirect to anywhere.
They are just the parent node in the menu.

Should I have:
<li>
<a href="#">services</a>
<ul>

Or
<li>
<a href="#Services">fly on pages</a>
<ul>

One has "#" the other "#Services".
Is there any difference in using one or the other?

Thanks,
Miguel
 
A

Adrienne Boswell

Gazing into my crystal ball I observed dorayme
Neither is well formed HTML, see

They are well formed if the are a parent node in a menu as the OP
stated.

<ul>
<li>Parent
<ul>
<li>Child</li>
</ul>
</li>
</ul>

To the OP, do you really need to put the href there at all? This seems
to be a list of headings with children, so:

<ul>
<li>Heading Item
<ul>
<li><a href="http://example.com">Child</li>
</ul>
</li>
<li>Heading Item
<ul>
<li><a href="http://example.org">Child Org</li>
</ul>
</li>
</ul>
 
D

dorayme

Adrienne Boswell said:
Gazing into my crystal ball I observed dorayme:

They are well formed if the are a parent node in a menu as the OP
stated.
I stand corrected but still weak from hunger for Portuguese food.
Without it, how is the brain to work so perfectly?
 
A

Adrienne Boswell

Gazing into my crystal ball I observed dorayme
I stand corrected but still weak from hunger for Portuguese food.
Without it, how is the brain to work so perfectly?

I work from hunger for African American Barbeque, but I settle for
Chicken and Mushrooms in Shallot Wine Sauce with Parmesean Couscous
instead.
 
J

Jukka K. Korpela

shapper said:
Some of the items should not redirect to anywhere.

Then don't make them links, as Adrienne explained.
One has "#" the other "#Services".
Is there any difference in using one or the other?

Yes. The former refers to the start of the current document. The latter
refers to an element with id="Services" or an <a> element with
name="Services" (and is erroneous, with unspecified behavior, if no such
element exists).
 

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
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top