O’Reilly members suffer live virtual training, plus books, videos, and digital contents from 200+ publishers.

You are watching: Html tags are instructions for a browser.


*

The just thing that is standing in between you and also getting yourself on the web is discovering to speak the lingo:

HyperText Markup Language, or HTML for short. So, obtain ready for part language lessons. ~ this chapter, not just are girlfriend going to know some simple elements that HTML, but you’ll additionally be able to speak HTML with a tiny style. Heck, by the end of this book you’ll be talk HTML choose you prospered up in Webville.


Want to get an idea the end there? sell something? simply need a an innovative outlet? rotate to the Web—we don’t must tell friend it has come to be the universal kind of communication. Even better, that a type of communication YOU deserve to participate in.

But if girlfriend really desire to usage the web effectively, you’ve gained to understand a few things about HTML—not to mention, a few things about how the net works too. Let’s take it a look indigenous 30,000 feet:


*

Web servers have a full-time job top top the Internet, tirelessly waiting for requests from net browsers. What type of requests? inquiry for web pages, images, sounds, or maybe also a video. Once a server gets a request for any kind of of these resources, the server finds the resource, and also then sends it ago to the browser.


*

You already know how a browser works: you’re surfing around the Web and also you click on a connect to visit a page. The click reasons your web browser to inquiry an HTML web page from a web server, retrieve it, and also display the page in your internet browser window.


*

But exactly how does the browser know exactly how to screen a page? That’s wherein HTML comes in. HTML speak the web browser all about the content and structure the the page. Stop see just how that works...


So, you know HTML is the key to obtaining a browser to display your pages, but what exactly does HTML look at like? and what does it do?

Let’s have a look in ~ a little HTML...imagine you’re walking to create a net page to advertise the Head very first Lounge, a regional hangout through some good tunes, refreshing elixirs, and wireless access. Here’s what you’d write in HTML:


*

Relax

We don’t suppose you to understand HTML yet.

At this suggest you should simply be acquiring a feeling for what HTML watch like; we’re going to cover everything in information in a bit. Because that now, study the HTML and also see exactly how it gets represented in the web browser on the next page. Be certain to pay cautious attention to every letter annotation and also how and where the is displayed in the browser.


When the browser reads her HTML, it interprets all the tags that surround your text. Tag are simply words or characters in edge brackets, like , , , and also so on. The tags phone call the browser about the structure and also meaning of her text. So rather than just giving the web browser a bunch that text, v HTML you can use tags to tell the web browser what text is in a heading, what message is a paragraph, what text requirements to be emphasized, or even where pictures need to be placed.

Let’s check out just how the internet browser interprets the tags in the Head an initial Lounge:


There room no Dumb Questions

Q:

Q: therefore HTML is just a bunch of tags that ns put around my text?

A:

A: because that starters. Remember that HTML represents HyperText Markup Language, so HTML provides you a means to “mark up” your text with tags that tell the internet browser how your message is structured. Yet there is additionally the HyperText element of HTML, which we’ll talk about a little later in the book.

Q:

Q: exactly how does the browser decide how to display the HTML?

A:

A: HTML tells her browser around the framework of her document: wherein the headings are, whereby the paragraphs are, what text demands emphasis, and so on. Offered this information, browsers have built-in default rule for just how to screen each of these elements.

But friend don’t need to settle because that the default settings. Friend can include your very own style and also formatting rules through CSS that recognize font, colors, size, and a most other features of your page. Fine get back to CSS later on in the chapter.

Q:

Q: The HTML because that the Head very first Lounge has actually all kinds of indentation and spacing, and yet i don’t watch that when it is displayed in the browser. Exactly how come?

A:

A: Correct, and an excellent catch. Browsers overlook tabs, returns, and also most spaces in HTML documents. Instead, they rely on your markup to determine where line and paragraph breaks occur.

So why did us insert our own formatting if the internet browser is simply going to disregard it? To aid us more easily review the record when we’re modifying the HTML. As your HTML documents become much more complicated, you’ll discover a couple of spaces, returns, and also tabs here and also there really aid to boost the readability that the HTML.

Q:

Q: for this reason there are two levels of headings, and a subheading

?

A:

A: actually there are six, v , which the web browser typically screens in successively smaller sized font sizes. Uneven you are creating a complicated and huge document, you typically won’t usage headings past

.

Q:

Q: Why execute I require the tag? no it apparent this is one HTML document?

A:

A: The tag speak the browser your file is actually HTML. While part browsers will certainly forgive you if you omit it, some won’t, and as we move toward “industrial-strength HTML” later in the book, you’ll watch it is quite essential to incorporate this tag.

Q:

Q: What provides a paper an HTML file?

A:

A: one HTML paper is a straightforward text file. Uneven a word processing file, there is no distinct formatting installed in it. Through convention, we include an “.html” come the end of the filename to provide the operating system a far better idea of what the document is. But, as you’ve seen, what yes, really matters is what we placed inside the file.

Q:

Q: anyone is talking about HTML5. Room we utilizing it? If so, why aren’t we saying “HTML-FIVE” rather of “HTML”?

A:

A: she learning around HTML, and HTML5 simply happens to be the latest version of HTML. HTML5 has had actually a most attention recently, and that’s because it simplifies plenty of of the methods we compose HTML and allows some new functionality, which we’re going to cover in this book. It additionally provides some progressed features v its JavaScript applications programming interfaces (APIs), and also those room covered in Head an initial HTML5 Programming.

Q:

Q: Markup appears silly. What-you-see-is-what-you-get applications have been roughly since, what, the ‘70s? Why isn’t the Web based upon a format like Microsoft indigenous or a comparable application?

A:

A: The net is created out that text records without any type of special formatting characters. This enables any browser in any component of the world to retrieve a internet page and also understand the contents. There room WYSIWYG applications out there like Dreamweaver, and also they work great. Yet in this publication we’re going to take it down to the bare metal, and start through text. Climate you’re in great shape to know what your Dreamweaver application is act behind the scenes.

See more: Swiss People Characteristics: What Do Swiss People Look Like ?

Q:

Q: Is over there any method to placed comments come myself in HTML?

A:

A: Yes, if you ar your comment in between the browser will completely ignore them. To speak you wanted to compose a comment “Here’s the start of the lounge content.” You’d perform that prefer this:

Notice that you deserve to put comment on multiple lines. Save in mental anything you put in between the “”, even HTML, will certainly be ignored by the browser.