[bcab] Re: html coding

        I must admit I'm not entirely sure of the thinking behind the move
to the id attribute. Using the id attribute means you don't need to use a
second <a> tag at the place where the link leads, as you can append it to
any tag you like. I believe it also provides greater accuracy across
browsers, but again I should stress I'm not certain.

        What I can be a bit more certain about, is the way HTML 5 is likely
to treat id and name attributes respectively. As I understand it, HTML 5
will be parsed so that an id is given higher priority than a name attribute
on the page. I believe also that the name attribute for the <a> tag is to be
deprecated in HTML 5. All that said, HTML 5 is still quite some way off and
I'm guessing much could change ahead of then.

        Sorry I can't be more conclusive.

Léonie.
 

-----Original Message-----
From: bcab-bounce@xxxxxxxxxxxxx [mailto:bcab-bounce@xxxxxxxxxxxxx] On Behalf
Of Karl Proud
Sent: 31 January 2009 17:06
To: bcab@xxxxxxxxxxxxx
Subject: [bcab] Re: html coding

Léonie,

Sorry to butt in to this thread, but I was wondering what ever happened to
using the name attribute to set points in a web page to jump to?

I am old, and it is possible that a whole load of standards could have
passed me by...

Serves me right for spending my youth being able to see and using
Dreamweaver.
 - code?  Who needs Code!

Cheers,
Karl

----- Original Message -----
From: "Léonie Watson" <tink@xxxxxxxxxx>
To: <bcab@xxxxxxxxxxxxx>
Sent: Saturday, January 31, 2009 12:16 PM
Subject: [bcab] Re: html coding


You're definitely on the right track Colin. Web addresses work a
little like building blocks, you can add bits to change the way a link
works.

Websites tend to have a page in the root, usually called index.html
or home.html or something similar. When you create a link to a website,
without specifying a particular page, it is this page that you're taken to.
In other words, the homepage of the website.

So the first link you gave would lead directly to the homepage of
the website. You don't need to put "index.html" at the end of the web
address because your web server will take care of that for you.

<a href="http://www.extremelyadventurous.co.uk";>Extremely Adventurous
Website</a>

You can have multiple files stored within your root folder. Most web
pages end with .html, rather than .txt though.

The following code would create a link to a page called about.html,
held in your root folder. The page would load, with focus at the top of the
page.

<a href="http://www.extremelyadventurous.co.uk/about.html";>About Us</a>

You can, as you know, point the link to a certain spot on a page.
For example, if your about.html page has a section which includes
information on the website's history, you could link directly to that
section.

You'd need to include a suitable id attribute on your about.html
page, typically at the start of the section. The code might look something
like this:

<p id="history">The Extremely Adventurous website was set up in 2009...</p>

The following code would create a link that opened the about.html
page, with focus taken directly to the section on the website's history.

<a href="http://www.extremelyadventurous.co.uk/about.html#history";>About Us
- Website History</a>

You can also store pages within other folders. For example, you
could have a folder called holidays within your root folder. Within the
holidays folder, you could have a page called lakes.html.

The following code would create a link to the lakes.html page. When
the page opens, focus would be at the top of the page.

<a href="http://www.extremelyadventurous.co.uk/holidays/lakes.html";>Lakes
Holidays</a>

Again, if you wanted a link to point directly to a certain section
of the lakes.html page, you would put an appropriate id attribute on the
page. For example:

<h2 id="weather">Weather by the lakes</h2>

<p>The weather by the lakes is usually sunny....</p>

The following code would then create a link to your lakes.html page,
held within the holidays sub folder. When the page opens, focus would be
given directly to the weather section on the page.

<a
href="http://www.extremelyadventurous.co.uk/holidays/lakes.html#weather";>Lak
es Holiday Taster - Weather</a>

So the web address you use is built up, depending on where you'd
like the link to point.

* To link to the homepage, just use the basic website address.
* To link to a specific page, add the name of the page to the end of the
basic web address.
* To link to a specific web page within another folder, add the folder name
and page name to the end of the basic web address.
* To link to a certain section on a page, add the folder and/or page names
to the end of the basic address, folowed by the fragment identifyer.

Hope this helps. It sounds as though your really getting to grips
with some of this stuff, and it's not always easy at the outset.

Léonie.

-----Original Message-----
From: bcab-bounce@xxxxxxxxxxxxx [mailto:bcab-bounce@xxxxxxxxxxxxx] On Behalf
Of Colin Fowler
Sent: 31 January 2009 10:26
To: bcab@xxxxxxxxxxxxx
Subject: [bcab] Re: html coding

Hi Chris,

OK, I've got that, but it now causes me to question the validity of my
hyperlinks, and I wondered if you could just explain the route hierarchy of
the url that I want to link to.


For example:

<a href="http://www.extremelyadventurous.co.uk   [that
obviously points to the
route folder]  if within that folder I had a file titled about.txt, would
the remainder of the hyperlink then be
/about.html#About">
About - who are we?</a>

Or by including the id fragmenter in there #about is this taking the link
direct to the id on the about.html page? and in that case, if I want people
to land at the top of the page would I exclude that bit?

and so on and so forth, so if I had a sub folder

for example <a
href="http://www.extremelyadventurous.co.uk/holidays/lakes.html#lakes";>lakes

adventure taster</a>
Sorry to sound so simple and confused, but even following the tutorials I am

still unsure, and I know that I can rely on help on this list.

Thanks

Colin


----- Original Message ----- 
From: "Chris Mills" <cmills@xxxxxxxxx>
To: <bcab@xxxxxxxxxxxxx>
Sent: Friday, January 30, 2009 8:54 AM
Subject: [bcab] Re: html coding


>
> On 30 Jan 2009, at 08:25, Colin Fowler wrote:
>
>> Hi,
>> Thanks to everyone for the previous help on this subject.
>>
>> I've another question now, how would I code a link to another page  so
>> that it lands exactly on the content within that page that I want  to
>> direct it to?
>>
>
> Hi Colin,
>
> You have to use an id to identify the content you want to jump to, and
> then link to it using an absolute URL plus a fragment identifier)
>
> So in the page you want to link to (say it has a URL of
> http://www.foodtips.com/fastfood.html) , you'd have something like the
> following:
>
> <p id="cheeseburgers">This is some content about cheeseburgers.</p>
>
> and then have the following link in the document you want to link to  it
> from:
>
> <p>See elsewhere on the site for <a
> href="http://www.foodtips.com/fastfood.html/#cheeseburgers ">More
> information about cheese burgers</a>.</p>
>
> you can use the id attribute on most HTML elements; you could link to
> exact section from the page just by using the fragment identifier on  its
> own, for example <a href="#cheeseburgers">More information about  cheese
> burgers</a>
>
> More information about links is available at
> http://dev.opera.com/articles/view/18-html-links-let-s-build-a-web/
> To find out more about BCAB and the benefits that membership can bring,
> please visit our website:
> http://www.bcab.org.uk/
>
> To manage your subscription to the BCAB mailing list, please visit our
> website:
> http://www.bcab.org.uk/mailing-list.html
>
> To discuss matters relating to the mailing list, please email
> bcab-moderators@xxxxxxxxxxxxx
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG. Version: 7.5.552 / Virus Database: 270.10.15/1924 -
> Release Date: 29/01/2009 17:57
>

To find out more about BCAB and the benefits that membership can bring,
please visit our website:
http://www.bcab.org.uk/

To manage your subscription to the BCAB mailing list, please visit our
website:
http://www.bcab.org.uk/mailing-list.html

To discuss matters relating to the mailing list, please email
bcab-moderators@xxxxxxxxxxxxx

To find out more about BCAB and the benefits that membership can bring, 
please visit our website:
http://www.bcab.org.uk/

To manage your subscription to the BCAB mailing list, please visit our 
website:
http://www.bcab.org.uk/mailing-list.html

To discuss matters relating to the mailing list, please email 
bcab-moderators@xxxxxxxxxxxxx

__________ NOD32 3815 (20090131) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


To find out more about BCAB and the benefits that membership can bring,
please visit our website:
http://www.bcab.org.uk/

To manage your subscription to the BCAB mailing list, please visit our
website:
http://www.bcab.org.uk/mailing-list.html

To discuss matters relating to the mailing list, please email
bcab-moderators@xxxxxxxxxxxxx

To find out more about BCAB and the benefits that membership can bring, please 
visit our website:
http://www.bcab.org.uk/

To manage your subscription to the BCAB mailing list, please visit our website:
http://www.bcab.org.uk/mailing-list.html

To discuss matters relating to the mailing list, please email 
bcab-moderators@xxxxxxxxxxxxx

Other related posts: