Reading-Notes

In this chapter, we will focus on some helpful topics that are not easily grouped together. You will learn about:

  1. The different versions of HTML and how to indicate which version you are using

  2. How to add comments to your code

  3. Global attributes, which are attributes that can be used on any element, including the class and id attributes

  4. Elements that are used to group together parts of the page where no other element is suitable

  5. How to embed a page within a page using iframes

  6. How to add information about the web page using the element

  7. Adding characters such as angled brackets and copyright symbols

The Evolution of HT ML

HTML 4

HTML 1.0

HTML 5

DOC Types

Because there have been several versions of HTML, each web page should begin with a DOCTYPE declaration to tell a browser which version of HTML the page is using (although browsers usually display the page even if it is not included). We will therefore be including one in each example for the rest of the book.

Comments in HTML

If you want to add a comment to your code that will not be visible in the user’s browser, you can add the text between these characters. It is a good idea to add comments to your code because, no matter how familiar you are with the page at the time of writing it, when you come back to it later (or if someone else needs to look at the code), comments will make it much easier to understand.

ID Attribute

Every HTML element can carry the id attribute. It is used to uniquely identify that element from other elements on the page. Its value should start with a letter or an underscore (not a number or any other character). It is important that no two elements on the same page have the same value for their id attributes (otherwise the value is no longer unique). As you will see when you come to look at CSS in the next section, giving an element a unique identity allows you to style it differently than any other instance of the same element on the page. For example, you might want to assign one paragraph within the page (perhaps a paragraph containing a pull quote) a different style than all of the other paragraphs. In the example on the right, the paragraph with the id attribute whose value is pullquote is made uppercase using CSS.

Class Attribute

Every HTML element can also carry a class attribute. Sometimes, rather than uniquely identifying one element within a document, you will want a way to identify several elements as being different from the other elements on the page. For example, you might have some paragraphs of text that contain information that is more important than others and want to distinguish these elements, or you might want to differentiate between links that point to other pages on your own site and links that point to external sites.

Block Elements

Some elements will always appear to start on a new line in the browser window. These are known as block level elements.

Inline Elements

Some elements will always appear to continue on the same line as their neighbouring elements. These are known as inline elements.

Grouping Text & Elements In a Block

The <div> element allows you to group a set of elements together in one block-level box. For example, you might create a <div> element to contain all of the elements for the header of your site (the logo and the navigation), or you might create a <div> element to contain comments from visitors. In a browser, the contents of the <div> element will start on a new line, but other than this it will make no difference to the presentation of the page.

## HTML5 Layout Ch17

They are covered here (rather than with the other HTML elements you met earlier in the book) because you’ll find it easier to understand how they can be used now that you have seen how CSS can control the layout a page. These new elements are going to play an important part in creating layouts going forward. In this chapter you will see:

  1. The new HTML5 layout elements and their uses
  2. How they offer helpful alternatives to the <div> element
  3. How to ensure older browsers recognize these elements

for more information https://www.w3schools.com/html/html_layout.asp

Process & Design Ch18

In this chapter, we will focus on some helpful topics that are not easily grouped together. You will learn about:

  1. How to approach building a site
  2. Understanding your audience and their needs
  3. How to present information visitors want to see

What Your Visitors are Trying to Achieve

Gordon

Bought a tennis racquet several years ago; now he wants to purchase one from your site for his girlfriend.

Molly

has read about your new doggy daycare service in the press and wants to find out whether it would be suitable for her to use.

Jasper

had a bad experience staying in a hotel when visiting Sydney, Australia, and wants to make a complaint.

Ayo

hopes to study architecture and wants to learn more about a new course that is being offered.

Ivy

is a picture editor and wants to look at a photographer’s site to see## examples of his work before deciding whether to commission him.

Site Maps

The aim is to create a diagram of the pages that will be used to structure the site. This is known as a site map and it will show how those pages can be grouped. To help you decide what information should go on each page, you can use a technique called card sorting. This involves placing each piece of information that a visitor might need to know on a separate piece of paper and then organizing the related information into groups. The aim is to create a diagram of the pages that will be used to structure the site. This is known as a site map and it will show how those pages can be grouped. To help you decide what information should go on each page, you can use a technique called card sorting. This involves placing each piece of information that a visitor might need to know on a separate piece of paper and then organizing the related information into groups.

Extra Markup

In this chapter, we will focus on some helpful topics that are not easily grouped together. You will learn about: