Basic HTML Tags
If you lookup the basic HTML tags in the reference below, you will see that the reference contains additional information about tag attributes.
Tag
|
Description
|
Defines an HTML document
| |
Defines the document's body
| |
Defines header 1 to header 6
| |
Defines a paragraph
| |
Inserts a single line break
| |
Defines a horizontal rule
| |
Defines a comment
|
HTML Attributes
Attributes provide additional information to an HTML element.
HTML Tag Attributes
HTML tags can have attributes. Attributes provide additional information to an HTML element.
Attributes always come in name/value pairs like this: name="value".Attributes are always specified in the start tag of an HTML element.
Attributes Example 1:
<h1> defines the start of a heading.<h1 align="center"> has additional information about the alignment.
Attributes Example 2:
<body> defines the body of an HTML document.<body bgcolor="yellow"> has additional information about the background color.
Attributes Example 3:
<table> defines an HTML table. (You will learn more about HTML tables later)<table border="1"> has additional information about the border around the table.
Use Lowercase Attributes
Attributes and attribute values are case-insensitive. However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation, and XHTML demands lowercase attributes/attribute values.HTML Text Formatting
HTML defines a lot of elements for formatting output, like bold or italic text.
Below are a lot of examples that you can try out yourself:
How to View HTML Source
Have you ever seen a Web page and wondered "Hey! How did they do that?"To find out, click the VIEW option in your browser's toolbar and select SOURCE or PAGE SOURCE. This will open a window that shows you the HTML code of the page.
Text Formatting Tags
Tag
|
Description
|
Defines bold text
| |
Defines big text
| |
Defines emphasized text
| |
Defines italic text
| |
Defines small text
| |
Defines strong text
| |
Defines subscripted text
| |
Defines superscripted text
| |
Defines inserted text
| |
Defines deleted text
| |
Deprecated. Use <del> instead
| |
Deprecated. Use <del> instead
| |
Deprecated. Use styles instead
|
"Computer Output" Tags
Tag
|
Description
|
Defines computer code text
| |
Defines keyboard text
| |
Defines sample computer code
| |
Defines teletype text
| |
Defines a variable
| |
Defines preformatted text
| |
<listing>
|
Deprecated. Use <pre> instead
|
<plaintext>
|
Deprecated. Use <pre> instead
|
<xmp>
|
Deprecated. Use <pre> instead
|
Citations, Quotations, and Definition Tags
Tag
|
Description
|
Defines an abbreviation
| |
Defines an acronym
| |
Defines an address element
| |
Defines the text direction
| |
Defines a long quotation
| |
Defines a short quotation
| |
Defines a citation
| |
Defines a definition term
|
HTML Character Entities
Some characters like the < character, have a special meaning in HTML, and therefore cannot be used in the text.
To display a less than sign (<) in HTML, we have to use a character entity.
Character Entities
Some characters have a special meaning in HTML, like the less than sign (<) that defines the start of an HTML tag. If we want the browser to actually display these characters we must insert character entities in the HTML source.A character entity has three parts: an ampersand (&), an entity name or a # and an entity number, and finally a semicolon (;).
To display a less than sign in an HTML document we must write: < or <
The advantage of using a name instead of a number is that a name is easier to remember. The disadvantage is that not all browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers.
Note that the entities are case sensitive.
Non-breaking Space
The most common character entity in HTML is the non-breaking space.Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them. To add spaces to your text, use the character entity.
The Most Common Character Entities:
Result
|
Description
|
Entity Name
|
Entity Number
|
non-breaking space
|
|
 
| |
<
|
less than
|
<
|
<
|
>
|
greater than
|
>
|
>
|
&
|
ampersand
|
&
|
&
|
"
|
quotation mark
|
"
|
"
|
'
|
apostrophe
|
' (does not work in IE)
|
'
|
Some Other Commonly Used Character Entities:
Result
|
Description
|
Entity Name
|
Entity Number
|
¢
|
Cent
|
¢
|
¢
|
£
|
Pound
|
£
|
£
|
¥
|
Yen
|
¥
|
¥
|
€
|
Euro
|
€
|
€
|
§
|
section
|
§
|
§
|
©
|
copyright
|
©
|
©
|
®
|
registered trademark
|
®
|
®
|
×
|
multiplication
|
×
|
×
|
÷
|
division
|
÷
|
÷
|
HTML Links
HTML uses a hyperlink to link to another document on the Web.
The Anchor Tag and the Href Attribute
HTML uses the <a> (anchor) tag to create a link to another document.An anchor can point to any resource on the Web: an HTML page, an image, a sound file, a movie, etc.
The syntax of creating an anchor:
<a href="url">Text to be displayed</a>
|
This anchor defines a link to W3Schools:
<a href="http://www.w3schools.com/">Visit W3Schools!</a>
|
The Target Attribute
With the target attribute, you can define where the linked document will be opened.The line below will open the document in a new browser window:
<a href="http://www.w3schools.com/"
target="_blank">Visit W3Schools!</a>
|
The Anchor Tag and the Name Attribute
The name attribute is used to create a named anchor. When using named anchors we can create links that can jump directly into a specific section on a page, instead of letting the user scroll around to find what he/she is looking for.Below is the syntax of a named anchor:
<a name="label">Text to be displayed</a>
|
The line below defines a named anchor:
<a name="tips">Useful Tips Section</a>.
|
To link directly to the "tips" section, add a # sign and the name of the anchor to the end of a URL, like this:
<a href="http://www.w3schools.com/html_links.asp#tips">
Jump to the Useful Tips Section</a>
|
<a href="#tips">Jump to the Useful Tips Section</a>
|
Basic Notes - Useful Tips
Always add a trailing slash to subfolder references. If you link like this: href="http://www.w3schools.com/html", you will generate two HTTP requests to the server, because the server will add a slash to the address and create a new request like this: href="http://www.w3schools.com/html/"Named anchors are often used to create "table of contents" at the beginning of a large document. Each chapter within the document is given a named anchor, and links to each of these anchors are put at the top of the document.
If a browser cannot find a named anchor that has been specified, it goes to the top of the document. No error occurs.
Link Tags
Tag
|
Description
|
Defines an anchor
|
HTML Frames
With frames, you can display more than one Web page in the same browser window.
Frames
With frames, you can display more than one HTML document in the same browser window. Each HTML document is called a frame, and each frame is independent of the others.The disadvantages of using frames are:
- The web developer must keep track of more HTML documents
- It is difficult to print the entire page
The Frameset Tag
- The <frameset> tag defines how to divide the window into frames
- Each frameset defines a set of rows or columns
- The values of the rows/columns indicate the amount of screen area each row/column will occupy
The Frame Tag
- The <frame> tag defines what HTML document to put into each frame
<frameset cols="25%,75%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
</frameset>
|
Basic Notes - Useful Tips
If a frame has visible borders, the user can resize it by dragging the border. To prevent a user from doing this, you can add noresize="noresize" to the <frame> tag.Add the <noframes> tag for browsers that do not support frames.
Important: You cannot use the <body></body> tags together with the <frameset></frameset> tags! However, if you add a <noframes> tag containing some text for browsers that do not support frames, you will have to enclose the text in <body></body> tags!.
Frame Tags
Tag
|
Description
|
Defines a set of frames
| |
Defines a sub window (a frame)
| |
Defines a noframe section for browsers that do not handle frames
| |
Defines an inline sub window (frame)
|
https://www.welookups.com/tags/tag_abbr.html
ReplyDelete