473,796 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<a name=foo> close?

This seems too simple by I can't find the answer.

Must <a name="foo"> be closed with </a> ?
Must it have content?

W3C says the content cannot be block so what if :

<a name="foo">
<h2>Foo Is Good</h2> ( a likely location )

Where does the closer </a> go?

<a name="foo">&nbs p;</a> is ok but uses a line
<h2>Foo Is Good</h2>

Mason C
Jul 24 '05 #1
30 2845
Previously in comp.infosystem s.www.authoring.html, "Mason A. Clark"
<ma************ *@ix.netcom.com > said:
Must <a name="foo"> be closed with </a> ?
Yes, according to the DTD.
Must it have content?
Yes, as above.
<a name="foo">
<h2>Foo Is Good</h2> ( a likely location )


How about:

<h2 id="foo">Foo Is Good</h2>

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 24 '05 #2
On 7-7-2005 9:07, Mason A. Clark wrote:
This seems too simple by I can't find the answer.

Must <a name="foo"> be closed with </a> ? For HTML 4.01: Yes, "Start tag: required, End tag: required", see
<http://www.w3.org/TR/html401/struct/links.html#edef-A> Must it have content? No, however "User agents should be able to find anchors created by empty
A elements, but some fail to do so."
W3C says the content cannot be block so what if :

<a name="foo"> </a> <h2>Foo Is Good</h2> ( a likely location )

Where does the closer </a> go?

<a name="foo">&nbs p;</a> is ok but uses a line
<h2>Foo Is Good</h2>
How about
<h2><a name="foo">Foo Is Good</a></h2> Mason C

--
Regards,

Roland de Ruiter
` ___ ___
`/__/ w_/ /__/
/ \ /_/ / \
Jul 24 '05 #3
Previously in comp.infosystem s.www.authoring.html, Mark Parnell
<we*******@clar kecomputers.com .au> said:
Previously in comp.infosystem s.www.authoring.html, "Mason A. Clark"
<ma************ *@ix.netcom.com > said:
Must it have content?


Yes, as above.


My bad. No, it doesn't have to have content.

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 24 '05 #4
On Thu, 07 Jul 2005 09:25:03 +0200, Roland <ro****@phony.b iz> wrote:
On 7-7-2005 9:07, Mason A. Clark wrote:
This seems too simple by I can't find the answer.

Must <a name="foo"> be closed with </a> ?

For HTML 4.01: Yes, "Start tag: required, End tag: required", see
<http://www.w3.org/TR/html401/struct/links.html#edef-A>
Must it have content?

No, however "User agents should be able to find anchors created by empty
A elements, but some fail to do so."


That's exactly what got me into this: - failure to find empty <a...></a>

<H2 id="fooname" .. has been suggested.

But the W3C site says:

"However, browser support for ID link destinations is very poor, so A NAME will
be needed for quite awhile. "

At the moment I'm stuck with <a name="foo">&nbs p;</a> and a line
used for the space.

Mason C

W3C says the content cannot be block so what if :

<a name="foo">

</a>
<h2>Foo Is Good</h2> ( a likely location )

Where does the closer </a> go?

<a name="foo">&nbs p;</a> is ok but uses a line
<h2>Foo Is Good</h2>

How about
<h2><a name="foo">Foo Is Good</a></h2>
Mason C


Jul 24 '05 #5
On Thu, 7 Jul 2005 17:17:47 +1000, Mark Parnell
<we*******@clar kecomputers.com .au> wrote:
Previously in comp.infosystem s.www.authoring.html, "Mason A. Clark"
<ma*********** **@ix.netcom.co m> said:
Must <a name="foo"> be closed with </a> ?


Yes, according to the DTD.
Must it have content?


Yes, as above.
<a name="foo">
<h2>Foo Is Good</h2> ( a likely location )


How about:

<h2 id="foo">Foo Is Good</h2>


see my comment in another post: W3C warns against this

Jul 24 '05 #6
Els
Mason A. Clark wrote:
On Thu, 07 Jul 2005 09:25:03 +0200, Roland <ro****@phony.b iz> wrote:
On 7-7-2005 9:07, Mason A. Clark wrote:
This seems too simple by I can't find the answer.

Must <a name="foo"> be closed with </a> ?

For HTML 4.01: Yes, "Start tag: required, End tag: required", see
<http://www.w3.org/TR/html401/struct/links.html#edef-A>
Must it have content?

No, however "User agents should be able to find anchors created by empty
A elements, but some fail to do so."


That's exactly what got me into this: - failure to find empty <a...></a>

<H2 id="fooname" .. has been suggested.

But the W3C site says:

"However, browser support for ID link destinations is very poor, so A NAME will
be needed for quite awhile. "

At the moment I'm stuck with <a name="foo">&nbs p;</a> and a line
used for the space.


Can't say I've found a user agent yet that fails to find <a id="foo"
name="foo"></a>. Anyone know which one would fail that?

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Squeeze - Can of Worms
Jul 24 '05 #7
On Thu, 7 Jul 2005, Mason A. Clark wrote:
This seems too simple by I can't find the answer.
Use a formal validator to verify the answers to most of your
questions.
Must <a name="foo"> be closed with </a> ?
yes.
Must it have content?
In theory "not necessarily", but some older browsers do require it or
they don't work. Whether you can be bothered to be compatible with
such older browsers is probably your choice now - some authors feel
that using the id= attribute on the appropriate element (in your case
the "h2") is now adequate and the use of "a name=" is a superfluous
compatibility feature, we can't tell you what your decision should be
on that, but let's assume that you still want to...
W3C says the content cannot be block
right, and so will a formal validator
so what if :

<a name="foo">
<h2>Foo Is Good</h2> ( a likely location )
Put <a name="foo" id="foo">...</a> inside the block element if you
want to cover all bases. One possibility would be:

<h2><a name="foo" id="foo">Foo Is Good</a></h2>
<a name="foo">&nbs p;</a> is ok but uses a line


No need to invent fake content!

Watch your CSS styles - if you've specified a style for /all/ "a"
elements, then it's going to get applied to this "a" element too,
which might not be what you want. Use a:link etc. to make the styles
more selective.

hope this helps.
Jul 24 '05 #8
Mason A. Clark wrote:
"However, browser support for ID link destinations is very poor, so A NAME
will be needed for quite awhile. "


When was that document written? The last browser I know which didn't support
id in that way was Netscape 4.x.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #9
Mason A. Clark wrote:
On Thu, 07 Jul 2005 09:25:03 +0200, Roland <ro****@phony.b iz> wrote:
On 7-7-2005 9:07, Mason A. Clark wrote:
[snip]
At the moment I'm stuck with <a name="foo">&nbs p;</a> and a line
used for the space.

Mason C


You must have missed Roland's suggestion below:

[snip]How about
<h2><a name="foo">Foo Is Good</a></h2>

Jul 24 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2314
by: Fredrik Melin | last post by:
Hi, I have a vendor that requires me to send empty value, e.g. <OrderIDInfo /> problem is that my xslt need to add attributes, doing this <OrderIDInfo> <xsl:attribute name="orderID"> <xsl:value-of select="Root_Element/InvoiceHeader/Customer_PO_No" /> </xsl:attribute>
18
3131
by: lchian | last post by:
Hi, I have a vector of class Foo. When I do a push_back(), I expect stl to call the default constructor I wrote for Foo. But instead, stl makes up its own default that is initialized with garbage. Is there a way to force stl to use MY default constructor?
8
4888
by: Joseph Turian | last post by:
Some function requires a vector<const foo*> argument. How can I cast a vector<foo*> to vector<const foo*>? Thanks! Joseph
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.