hey this is ralph and in this video I
want to talk a little bit about
the anchor tag and the relationship attribute.
[intro music playing]
OK, so the relationship
attribute for the anchor tags i'm over
here at the specs for html5.2 over
the w3c i'm looking at the anchor
element and i'm looking at the list of
global attributes and specifically the
REL or relationship attribute and
I'm guilty of not using this one
probably as much as I should but it came
up with a webpage other day so I just
want to kind of mention a couple
things you can do with this so if i look
at the relationship
attribute we'll see some various choices
now a lot of you might be familiar with
a relationship attribute especially when
using it with your style tag so in my
head section if I had a link tag i might
use an REL attribute as part of relating
an external style sheet and this is
where i use it practically all the time
however the relationship attribute can
also be used in an anchor tag and
several of these link types focus
specifically on use with anchor tags or
hyperlinks don't confuse the link
element with the anchor tag which is a
hyperlink element
ok so there's a number of different
choices here some of these are more
appropriate for a link tag versus an
anchor tag but just so we can see how a
couple of these might work
notice the sequential link types down
here next and previous I bet there's a
lot of situations where you and I have
worked on web pages where these could
have come in handy so you're making an
anchor tag to another document i'll just
say page five
I could do REL equals next and i can
put in the word next and i'll just put a
little manual arrow there
ok so the word next is going to be the
hyperlink maybe I've got an arrow by the
way this could also be an image with an
arrow and I'm kind of trying to lead the
visitor through a series of pages that
are connected these could be catalog
pages in a store something like that i'm
browsing ikea catalog online while the
relationship of the hyperlink page to
the current page with well it's the next
page and of course similarly if I'm on
page four we could have page three and
the relationship would be previous so it
gives extra information to the user
agent. Remember, the user agent is our
browser so this isn't necessarily going
to be more helpful to the visitor unless
the visitor has a special need for this
so for instance somebody with a
disability of perhaps a vision
disability
there are aural browser or their Braille
browser may rely on this extra content
in order to help navigate the website so
next and previous are really good
examples of something you might start
using sooner rather than later
here's another one that might pop up
quite a bit link type nofollow so where
this would come into play say I've got a
hyperlink and i'll put in my gallery
ok the nofollow value for the
relationship attribute is really
a specific piece of information for any
kind of a crawler or a spider that might
be tracking your page or following your
page to add it to a search engine and
for various reasons you do not want that
search engine to follow this particular
hyperlink to start indexing that
particular page now of course you could
control that on the page itself on the
gallery page i could have a meta robots
that had no index but i can also take
care of her right here because remember
that's basically the way spiders work as
they go to a web page they start to
record information and then they follow
all of the hyperlinks by default so I'm
telling this browser i do not want you
to follow this particular hyperlink I
don't want this page indexed for some
reason so the relationship attribute has
a number of aspects or a number of
features you can apply which are going
to enhance the anchor tag and then of
course we can see that they're similar
things i want to show that this
particular anchor tag is to the author
of the article or document i want to
show that this anchor tag is an ideal
bookmark i want to show that this anchor
tag is a help information of frequently
asked questions something like that so
that way other users with those needs
can get extra information about the
anchor tag and last but not least let me
go and point this out i'll go and click
on link type search and we'll see on the
5.2 specs that the link type search can
be used with the link tag the anchor tag
and the area tag and if you haven't used
the area tag before we'll check that out
soon enough but the area tag is a
supporting element for an image map so
if i had a large image and sections of
that image were clickable hotspots i would
use the area tag to mark out the shape
and the size of that particular hotspot
so you can think of the area tag as
an alternative to the anchor tag it does
create a clickable link area when doing
an image map so you
find that a lot of these link types that
work for the anchor tag will also work
for the area tag
ok so for your next page start
considering where you're going to use
the relationship attribute
Không có nhận xét nào:
Đăng nhận xét