Going back to the top of the page

J

Jani

Now to dump
the empty A element... Simply do this:

<body id="top">
...
To the <a href=#top">top</a> of the page because I cannot find the
"home" key!

or fill it with &nbsp; ?
 
J

Jonathan N. Little

Jani said:
or fill it with &nbsp; ?

Missing the point entirely. Why add an empty element that serves no
purpose other than supply a anchor when toy can use an existing element
and create your anchor with an ID. That is like using empty <p></p> or
table rows for creating padding!
 
J

Jani

Missing the point entirely. Why add an empty element that serves no
purpose other than supply a anchor when toy can use an existing element
and create your anchor with an ID. That is like using empty <p></p> or
table rows for creating padding!

I remember this "era", when they used a small transparent gif 1x1 px
to achieve some effect. LOL
 
B

Bergamot

Neredbojias said:
I still use that, and it _is_ necessary.

If you find it necessary, you are probably doing something wrong, or at
least inefficiently. I haven't used spacer gifs for about 10 years now.
 
N

Neredbojias

If you find it necessary, you are probably doing something wrong, or
at least inefficiently. I haven't used spacer gifs for about 10 years
now.

Hah, I knew somebody would take the bait...

Not at all, Holmes. I'm not using it as a spacer gif but as the last
image in a container to "finalize" justification of the previous (last)
line of images. There is no other way to do that I'm aware of.
 
A

Adrian

Jonathan N. Little said:
While you *can* use an empty A element for an anchor, that is just soooooo
last millennium! Use an ID attribute and forego the superfluous empty
element.

Now I keep seeing this thought the thread, you cannot have a digit for the
leading character for an anchor identifier:

http://www.w3.org/TR/html4/types.html#h-6.2
Basic HTML data types

So you could have it a "anchor0" or "top" may be simpler. Now to dump the
empty A element... Simply do this:

<body id="top">
...
To the <a href=#top">top</a> of the page because I cannot find the "home"
key!

Thank you for your helpful response.
Much appreciated.

Adrian.
 
J

Jani

I haven't looked but it sounds like Youtube is using it as a cover
(layer-over) for their logo image via css.

Yes, could be like that.

In the CSS file you find this: (and much more aswell)

#masthead .logo{
float: left;
display: block;
margin-top: 2px;
margin-bottom: 4px;
}
#masthead .logo img{
width: 84px;
height: 33px;
background: white url(http://s.ytimg.com/yt/img/master-vfl69326.gif)
no-repeat scroll 0 0;

The master-vfl69326.gif is a big gif with many logos, buttons, signs,
etc.
Then they cut I think from the top left { width: 84px; height:
33px; } ... the YouTube - logo.
And then it is placed { margin-top: 2px; margin-bottom: 4px; } to get
a little space in between the logo and the "container".

The source code of the page has this:
<div id="masthead">
<a href="/" onmousedown="urchinTracker('/Events/Header_3/
YouTubeLogo');" class="logo"><img src="http://s.ytimg.com/yt/img/pixel-
vfl73.gif" border="0" alt=""/></a>
 

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
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top