Online Book Reader

Home Category

HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [41]

By Root 1392 0
my favorite Web sites is called

wikipedia.

This terrific site allows ordinary users to enter

encyclopedia definitions. Over time, the entries

can be as reliable as a commercial encyclopedia,

and a lot more complete.

Dummies

You can find out a lot about upcoming and current

Dummies books at

www.dummies.com. You might even find this

book mentioned there.

PopURLS

Web 2.0 is all about social networking. If you want

to know what’s happening on the Internet today,

check out

popurls.com. This site aggregates a bunch of

social networking sites.

As you can see, the anchor tag is embedded into paragraphs. The text generally flows around an anchor, and you can see the anchor code is embedded inside the paragraphs.


Comparing block-level and inline elements

All the tags described so far in this book have been block-level tags. Block-level tags typically begin and end with carriage returns. For example, three

tags occupy three lines. Each

set has implied space above and below it. Most XHTML tags are block-level.

Some tags are meant to be embedded inside block-level tags and don’t interrupt the flow of the text. The anchor tag is one such tag. Anchors never stand on their own in the HTML body. This type of tag is an inline tag. They’re meant to be embedded inside block-level tags, such as list items, paragraphs, and headings.


Analyzing an anchor

The first link shows all the main parts of an anchor in a pretty straightforward way:

wikipedia.

♦ The anchor tag itself: The anchor tag is simply the pair. You don’t type the entire word anchor, just the a.

♦ The hypertext reference (href) attribute: Almost all anchors contain this attribute. It’s very rare to write

♦ A Web address in quotes: The address that the browser will follow is encased in quotes. See the next section in this chapter for more information on Web addresses. In this example, http://www.wikipedia.org is the address.

♦ The text that appears as a link: The user will typically expect to click specially formatted text. Any text that appears between the part and the part is visible on the page and formatted as a link. In this example, the word wikipedia is the linked text.

♦ The marker: This marker indicates that the text link is finished.

Introducing URLs

The special link addresses are a very important part of the Web. You probably already type Web addresses into the address bar of your browser (http://www.google.com), but you may not be completely aware of how they work. Web addresses are technically URLs (Uniform Resource Locators), and they have a very specific format.

Sometimes, you’ll see the term URI (Uniform Resource Identifier) instead of URL. URI is technically a more correct name for Web addresses, but the term URL has caught on. The two terms are close enough to be interchangeable.

A URL usually contains the following parts:

♦ Protocol: A Web protocol is a standardized agreement on how communication occurs. The Web primarily uses HTTP (hypertext transfer protocol), but occasionally, you encounter others. Most addresses begin with http:// because this is the standard on the Web. Protocols usually end with a colon and two slashes (://).

♦ Host name: It’s traditional to name your primary Web server www. There’s no requirement for this, but it’s common enough that users expect to type www right after the http:// stuff. Regardless, the text right after http:// (and up to the first period) is the name of the actual computer you’re linking to.

♦ Domain name: The last two or three characters indicate a particular type of Web server. These letters can indicate useful information about the type of organization that houses the page.

Return Main Page Previous Page Next Page

®Online Book Reader