HTMLreview
HTML REVIEW
The title Attribute
The title
attribute defines some extra information about an element.
The value of the title attribute will be displayed as a tooltip when you mouse over the element:
1 |
|
Single or Double Quotes?
Double quotes around attribute values are the most common in HTML, but single quotes can also be used.
In some situations, when the attribute value itself contains double quotes, it is necessary to use single quotes:
1 |
|
HTML Display
You cannot be sure how HTML will be displayed.
Large or small screens, and resized windows will create different results.
With HTML, you cannot change the display by adding extra spaces or extra lines in your HTML code.
The browser will automatically remove any extra spaces and lines when the page is displayed:
HTML Horizontal Rules < hr >
The <hr>
tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.
The <hr>
element is used to separate content (or define a change) in an HTML page:
The HTML < pre > Element
The HTML <pre>
element defines preformatted text.
The text inside a <pre>
element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:
Tag | Description |
---|---|
< p > | Defines a paragraph |
< hr > | Defines a thematic change in the content |
< br > | Inserts a single line break |
< pr > | Defines pre-formatted text |
Text Alignment
The CSS text-align
property defines the horizontal text alignment for an HTML element:
1 | <h1 style="text-align:center;">Centered Heading</h1> |
Centered Heading
Centered paragraph.
HTML Formatting Elements
Formatting elements were designed to display special types of text:
<b>
- Bold text<strong>
- Important text, bold<i>
- Italic text<em>
- Emphasized text, italic<mark>
- Marked text, highlight<small>
- Smaller text<del>
- Deleted text<ins>
- Inserted text, underline<sub>
- Subscript text, higher<sup>
- Superscript text, lower
HTML Quotation and Citation Elements
Tag | Description |
---|---|
abbr | Defines an abbreviation or acronym |
address | Defines contact information for the author/owner of a document |
bdo | Defines the text direction. BDO stands for Bi-Directional Override.is used to override the current text direction |
blockquote | Defines a section that is quoted from another source |
cite | Defines the title of a work (e.g. a book, a poem, a song, a movie, a painting, a sculpture, etc.) |
q | Defines a short inline quotation |
HTML Comments
1 | <p>This is a paragraph.</p> |
HTML Colors
HTML colors are specified with predefined color names, or with RGB, HEX, HSL, RGBA, or HSLA values.
HTML links
To use an image as a link, just put the <img>
tag inside the <a>
tag:
1 | <a href="default.asp"> |
Use mailto:
inside the href
attribute to create a link that opens the user’s email program (to let them send a new email):
1 | <a href="mailto:someone@example.com">Send email</a> |
To use an HTML button as a link, you have to add some JavaScript code.
JavaScript allows you to specify what happens at certain events, such as a click of a button:
1 | <button onclick="document.location='default.asp'">HTML Tutorial</button> |
target attribute
By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link.
The target
attribute specifies where to open the linked document.
The target
attribute can have one of the following values:
_self
- Default. Opens the document in the same window/tab as it was clicked_blank
- Opens the document in a new window or tab_parent
- Opens the document in the parent frame_top
- Opens the document in the full body of the window
1 |
|
HTML Link
https://www.w3schools.com/html/html_links_colors.asp
HTML Image Maps
https://www.w3schools.com/html/html_images_imagemap.asp
HTML Image Tags
Tag | Description |
---|---|
img | Defines an image |
map | Defines an image map |
area | Defines a clickable area inside an image map |
picture | Defines a container for multiple image resources |
table
td
stands for table data.
tr
stands for table row.
th
stands for table header.
1 |
|
HTML List
- Use the HTML
<dl>
element to define a description list - Use the HTML
<dt>
element to define the description term - Use the HTML
<dd>
element to describe the term in a description list
block inline
https://www.w3schools.com/html/html_blocks.asp
Path
Path | Description |
---|---|
< img src=”picture.jpg”> | The “picture.jpg” file is located in the same folder as the current page |
< img src=”images/picture.jpg”> | The “picture.jpg” file is located in the images folder in the current folder |
< img src=”/images/picture.jpg”> | The “picture.jpg” file is located in the images folder at the root of the current web |
< img src=”../picture.jpg”> | The “picture.jpg” file is located in the folder one level up from the current folder |