HTML and CSS Reference
In-Depth Information
Click here to view code image
1. <a href="http://shayhowe.com/" >Shay Howe</a>
The preceding code will display the text “Shay Howe” on the web page (see Figure 1.1 )
and will take users to http://shayhowe.com/ upon clicking the “Shay Howe” text. The
anchor element is declared with the opening <a> and closing </a> tags encompassing
the
text,
and
the
hyperlink
reference
attribute
and
value
are
declared
with
href="http://shayhowe.com" in the opening tag (see Figure 1.2 ) .
Figure 1.1 An anchor element creating a “Shay Howe” hyperlink
Figure 1.2 HTML syntax outline including an element, attribute, and tag
Now that you know what HTML elements, tags, and attributes are, let's take a look at put-
ting together our first web page. If anything looks new here, no worries—we'll decipher it
as we go.
Setting Up the HTML Document Structure
HTML documents are plain text documents saved with an .html file extension rather than
a .txt file extension. To begin writing HTML, you first need a plain text editor that you
are comfortable using. Sadly this does not include Microsoft Word or Pages, as those are
rich text editors. Two of the more popular plain text editors for writing HTML and CSS are
Dreamweaver and Sublime Text. Free alternatives also include Notepad++ for Windows
and TextWrangler for Mac.
All HTML documents have a required structure that includes the following declaration and
elements: <!DOCTYPE html> , <html> , <head> , and <body> .
The document type declaration, or <!DOCTYPE html> , informs web browsers which
version of HTML is being used and is placed at the very beginning of the HTML document.
Because we'll be using the latest version of HTML, our document type declaration is
Search WWH ::




Custom Search