1. Trang chủ
  2. » Công Nghệ Thông Tin

Tự học HTML và CSS trong 1 giờ - part 4 pptx

10 384 2
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 1,05 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

You’ll learn the following: n How the World Wide Web really works n What web browsers do, and a couple of popular ones from which to choose n What a web server is, and why you need one n

Trang 1

This page intentionally left blank

Trang 2

Navigating the World

Wide Web

A journey of a thousand miles begins with a single step, and here you

are in Lesson 1 of a journey that will show you how to write, design, and

publish pages on the World Wide Web But before beginning the actual

journey, you should start simple, with the basics You’ll learn the following:

n How the World Wide Web really works

n What web browsers do, and a couple of popular ones from which

to choose

n What a web server is, and why you need one

n Some information about uniform resource locators (URLs)

These days, the Web is pervasive, and maybe most if not all of today’s

information will seem like old news If so, feel free to skim this lesson

and skip ahead to Lesson 2, “Preparing to Publish on the Web,” where

you’ll find an overview of points to think about when you design and

organize your own Web documents

Trang 3

How the World Wide Web Works

Chances are that you’ve used the Web, perhaps even a lot However, you might not have

done a lot of thinking about how it works under the covers In this first section, I

describe the Web at a more theoretical level so that you can understand how it works as a

platform

I have a friend who likes to describe things using many meaningful words strung

together in a chain so that it takes several minutes to sort out what he’s just said

If I were he, I’d describe the World Wide Web as a global, interactive, dynamic,

cross-platform, distributed, graphical hypertext information system that runs over the Internet

Whew! Unless you understand all these words and how they fit together, this description

isn’t going to make much sense (My friend often doesn’t make much sense, either.)

So, let’s look at all these words and see what they mean in the context of how you use

the Web as a publishing medium

The Web Is a Hypertext Information System

The idea behind hypertext is that instead of reading text in a rigid, linear structure (such

as a book), you can skip easily from one point to another You can get more information,

go back, jump to other topics, and navigate through the text based on what interests you

at the time

Hypertext enables you to read and navigate text and visual information in a nonlinear

way, based on what you want to know next

When you hear the term hypertext, think links (In fact, some people still refer to links as

hyperlinks.) Whenever you visit a web page, you’re almost certain to see links

through-out the page Some of the links might point to locations within that same page, others to

pages on the same site, and still others might point to pages on other sites Hypertext was

an old concept when the Web was invented—it was found in applications such as

HyperCard and various help systems However, the World Wide Web redefined how

large a hypertext system could be Even large websites were hypertext systems of a scale

not before seen, and when you take into account that it’s no more difficult to link to a

document on a server in Australia from a server in the United States than it is to link to a

Trang 4

1

Nearly all large corporations and medium-sized businesses and organizations are using web technology to manage projects, order materials, and distribute company information in a paperless envi-ronment By locating their documents on a private, secure web

server called an intranet, they take advantage of the technologies

the World Wide Web has to offer while keeping the information contained within the company.

The Web Is Graphical and Easy to Navigate

In the early days, using the Internet involved simple text-only applications You had to

navigate the Internet’s various services using command-line programs (think DOS) and

arcane tools Although plenty of information was available on the Net, it wasn’t

neces-sarily pretty to look at or easy to find

Then along came the first graphical web browser: Mosaic It paved the way for the Web

to display both text and graphics in full color on the same page The ability to create

complex, attractive pages rivaling those founds in books, magazines, and newspapers

propelled the popularity of the Web These days, the Web offers such a wide degree of

capabilities that people are writing web applications that replace desktop applications

A browser is used to view and navigate web pages and other information on the World

Wide Web Currently, the most popular browsers are Microsoft Internet Explorer,

Mozilla Firefox, Apple Safari, and Google Chrome In addition, more and more people

are using mobile devices to access the Web, most of which have their own browsers

NOTE

Hypertext or Hypermedia?

If the Web incorporates so much more than text, why do I keep calling the Web a

hypertext system? Well, if you’re going to be absolutely technically correct about it,

the Web is not a hypertext system—it’s a hypermedia system But, on the other

hand, you might argue that the Web began as a text-only system, and much of the

content is still text-heavy, with extra bits of media added in as emphasis I prefer the

term hypertext, and it’s my book, so I use it You know what I mean.

Trang 5

The Web Is Cross-Platform

If you can access the Internet, you can access the World Wide Web, regardless of

whether you’re working on a low-end PC or a fancy expensive workstation These days,

you can even access the Web from most mobile phones If you think Windows menus

and buttons look better than Macintosh menus and buttons or vice versa (or if you think

both Macintosh and Windows people are weenies), it doesn’t matter The World Wide

Web isn’t limited to any one kind of machine or developed by any one company The

Web is entirely cross-platform

Cross-platform means that you can access web information equally well from any

com-puter hardware running any operating system using any display

The Cross-Platform Ideal

The whole idea that the Web is—and should be—cross-platform is strongly held to

by purists The reality, however, is somewhat different With the introduction over the

years of numerous special features, technologies, and media types, the Web has

lost some of its capability to be truly cross-platform As web authors choose to use

these nonstandard features, they willingly limit the potential audience for the content

of their sites For example, a site centered on a Flash animation is essentially

unus-able for someone using a browser that doesn’t have a Flash player, or for a user

who might have turned off Flash for quicker downloads Similarly, some programs

that extend the capabilities of a browser (known as plug-ins) are available only for

one platform (either Windows, Macintosh, or UNIX) Choosing to use one of those

plug-ins makes that portion of your site unavailable to users who are either on the

wrong platform or don’t want to bother to download and install the plug-in.

The Web Is Distributed

Web content can take up a great deal of space, particularly when you include images,

audio, and video To store all the information, graphics, and multimedia published on the

Web, you would need an untold amount of disk space, and managing it would be almost

impossible (Not that there aren’t people who try.) Imagine that you were interested in

finding out more information about alpacas (Peruvian mammals known for their wool),

but when you selected a link in your online encyclopedia, your computer prompted you

Trang 6

The Web succeeds at providing so much information because that information is

distrib-uted globally across millions of websites, each of which contributes the space for the

information it publishes These sites reside on one or more computers, referred to as web

servers A web server is just a computer that listens for requests from web browsers and

responds to that request You, as a consumer of that information, request a resource from

the server to view it You don’t have to install it, change disks, or do anything other than

point your browser at that site

A website is a location on the Web that publishes some kind of information When you

view a web page, your browser connects to that website to get that information

Each website, and each page or bit of information on that site, has a unique address This

address is called a uniform resource locator or URL When people tell you to visit a site

at http://www.yahoo.com/, they’ve just given you a URL Whenever you use a browser to

visit a website, you get there using a URL You’ll learn more about URLs later in this

lesson in the “Uniform Resource Locators” section

The Web Is Dynamic

If you want a permanent copy of some information that’s stored on the Web, you have to

save it locally because the content can change any time, even while you’re viewing the

page

If you’re browsing that information, you don’t have to install a new version of the help

system, buy another book, or call technical support to get updated information Just

launch your browser and check out what’s there

If you’re publishing on the Web, you can make sure that your information is up-to-date

all the time You don’t have to spend a lot of time re-releasing updated documents

There’s no cost of materials You don’t have to get bids on numbers of copies or quality

of output Color is free And you won’t get calls from hapless customers who have a

ver-sion of the book that was obsolete 4 years ago

Consider a book published and distributed entirely online, such as Little Brother by Cory

Doctorow (which you can find at http://craphound.com/littlebrother/) He can correct any

mistakes in the book and simply upload the revised text to his website, making it

instantly available to his readers He can post pointers to foreign language translations of

the book as they arrive The website for the book appears in Figure 1.1

1

Trang 7

FIGURE 1.1

The website for

Little Brother.

The pictures throughout this book usually are taken in Safari run-ning on Mac OS X The only reason for this use is that I’m writing this book on an Apple Macintosh If you’re using a different oper-ating system, don’t feel left out As I noted earlier, the glory of the Web is that you see the same information regardless of the plat-form you use

For some sites, the capability to update the site on-the-fly, at any moment, is precisely

why the site exists Figure 1.2 shows the home page for Yahoo! News, an online news

site that’s updated 24 hours a day to reflect up-to-the-minute news as it happens Because

the site is up and available all the time, it has an immediacy that neither hard-copy

news-papers nor most television news programs can match Visit Yahoo! News at

http://news.yahoo.com

These days, you don’t even need to reload a web page to receive updated information

Through the use of JavaScript, which I discuss starting in Lesson 14, “Introducing

JavaScript,” you can update the contents of a page in real time The scores and statistics

on the NBA game page in Figure 1.3 are updated in place as the game progresses

NOTE

Trang 8

The Web Is Interactive

Interactivity is the capability to “talk back” to the web server More traditional media,

such as television, isn’t interactive in the slightest; all you do is sit and watch as shows

are played at you Other than changing the channel, you don’t have much control over

what you see The Web is inherently interactive; the act of selecting a link and jumping

to another web page to go somewhere else on the Web is a form of interactivity In

addi-tion to this simple interactivity, however, the Web enables you to communicate with the

publisher of the pages you’re reading and with other readers of those pages

For example, pages can be designed to contain interactive forms that readers can fill out

1

FIGURE 1.2

Yahoo! News.

FIGURE 1.3

Live game updates

on the CBS Sports

website.

Trang 9

As a publisher of information on the Web, you can use forms for many different

pur-poses, such as the following:

n To get feedback about your pages

n To get information from your readers (survey, voting, demographic, or any other

kind of data) You then can collect statistics on that data, store it in a database, or

do anything you want with it

n To provide online order forms for products or services available on the Web

n To create comment forms and forums that enable your readers to post their own

information on your pages These kinds of systems enable your readers to

commu-nicate not only with you, but also with other readers of your pages

In addition to forms, which provide some of the most popular forms of interactivity on

the Web, advanced features of web technologies provide even more interactivity Flash,

and JavaScript, for example, enable you to include entire programs and games inside

web pages Software can run on the Web to enable real-time chat sessions between your

readers As time goes on, the Web becomes less of a medium for people passively sitting

FIGURE 1.4

A registration

form.

Trang 10

Web Browsers

A web browser, as mentioned earlier, is the application you use to view pages and

navi-gate the World Wide Web A wide array of Web browsers is available for just about every

platform you can imagine Microsoft Internet Explorer, for example, is included with

Windows, and Safari is included with Mac OS X Mozilla Firefox, Google Chrome, and

Opera are all available as free downloads Currently, the most widely used is Microsoft

Internet Explorer (sometimes called just Internet Explorer or IE), but competing

browsers are increasing their share of the market These days, if you don’t take all the

popular browsers into account when creating your Web pages, you’ll limit your audience

substantially

1

Choosing to develop for a specific browser, such as Internet Explorer, is suitable when you know a limited audience using the targeted browser software will view your website Developing this way is a common practice in corporations implementing intranets.

In these situations, it’s a fair assumption that all users in the organization will use the browser supplied to them and, accord-ingly, it’s possible to design the web pages on an intranet to use the specific capabilities of the browser in question.

What the Browser Does

The core purpose of a web browser is to connect to web servers, request documents, and

then properly format and display those documents Web browsers can also display files

on your local computer, download files that are not meant to be displayed, and in some

cases even allow you to send and retrieve email What the browser is best at, however, is

dealing with retrieving and displaying web documents Each web page is a file written in

a language called the Hypertext Markup Language (HTML) that includes the text of the

page, a description of its structure, and links to other documents, images, or other media

The browser takes the information it gets from the web server and formats it for your

system Different browsers might format and display the same file in diverse ways,

depending on the capabilities of that system and how the browser is configured

Retrieving documents from the Web and formatting them for your system are the two tasks

that make up the core of a browser’s functionality Depending on the browser you use and

the features it includes, however, you can also play Flash animations, play multimedia

NOTE

Ngày đăng: 05/07/2014, 20:21

TỪ KHÓA LIÊN QUAN