Attribute | Details |
---|---|
src | Specifies the path to a JavaScript file. Either a relative or absolute URL. |
type | Specifies the MIME type. This attribute is required in HTML4, but optional in HTML5. |
async | Specifies that the script shall be executed asynchronously (only for external scripts). This attribute does not require any value (except of XHTML). |
defer | Specifies that the script shall be executed when the page has finished parsing (only for external scripts). This attribute does not require any value (except of XHTML). |
chrset | Specifies the character encoding used in an external script file, e.g. UTF |
crossorigin | How the element handles crossorigin requests |
nonce | Cryptographic nonce used in Content Security Policy checks CSP3 |
HTML
HTML 5 Notes For Professional – Chapter – 12 (Linking Resources)
Attribute | Details |
charset | Specifies the character encoding of the linked document |
crossorigin | Specifies how the element handles cross origin requests |
href | Specifies the location of the linked document |
hreflang | Specifies the language of the text in the linked document |
media | Specifies on what device the linked document will be displayed, often used with selecting stylesheets based on the device in question |
rel | Required. Specifies the relationship between the current document and the linked document |
rev | Specifies the relationship between the linked document and the current document |
sizes | Specifies the size of the linked resource. Only when rel="icon" |
target | Specifies where the linked document is to be loaded |
type | Specifies the media type of the linked document |
integrity | Specifies a base64 encoded hash (sha256, sha384, or sha512) of the linked resource allowing the browser to verify its legitimacy. |
While many scripts, icons, and stylesheets can be written straight into HTML markup, it is best practice and more efficient to include these resources in their own file and link them to your document. This topic covers linking external resources such as stylesheets and scripts into an HTML document.
HTML 5 Notes For Professional – Chapter – 11 (Data Attributes)
Value | Description |
some value | Specifies the value of the attribute (as a string) |
Older browsers support
Data attributes were introduced in HTML5 which is supported by all modern browsers, but older browsers before HTML5 don’t recognize the data attributes.
However, in HTML specifications, attributes that are not recognized by the browser must be left alone and the browser will simply ignore them when rendering the page.
Web developers have utilized this fact to create non-standard attributes which are any attributes not part of the HTML specifications. For example, the value
attribute in the line bellow is considered a non-standard attribute because of the specifications for the <img>
tag don’t have a value
attribute and it is not a global attribute:
<img src="sample.jpg" value="test" />
HTML 5 Notes For Professional – Chapter – 10 (Classes and IDs)
Parameters | Details |
class | Indicates the Class of the element (non-unique) |
id | Indicates the ID of the element (unique in the same context) |
Classes and IDs make referencing HTML elements from scripts and stylesheets easier. The class attribute can be used on one or more tags and is used by CSS for styling. IDs however are intended to refer to a single element, meaning the same ID should never be used twice. IDs are generally used with JavaScript and internal document links, and are discouraged in CSS. This topic contains helpful explanations and examples regarding proper usage of class and ID attributes in HTML.
HTML 5 Notes For Professional – Chapter – 8 – 9 (Tables & Comments)
TABLES
The HTML <table>
element allows web authors to display tabular data (such as text, images, links, other tables,etc.) in a two-dimensional table with rows and columns of cells.
HTML 5 Notes For Professional – Chapter – 7 (Lists)
HTML offers three ways for specifying lists: ordered lists, unordered lists, and description lists. Ordered lists use ordinal sequences to indicate the order of list elements, unordered lists use a defined symbol such as a bullet to list elements in no designated order, and description lists use indents to list elements with their children. This topic explains the implementation and combination of these lists in HTML markup.
HTML 5 Notes For Professional – Chapter – 6 (Anchors and Hyperlinks)
href
Specifies the destination address. It can be an absolute or relative URL or the name of an anchor. An absolute URL is the complete URL of a website like http://example.com/. A relative computer address points to a different directory and/or document within the constant web site, e.g. /about-us/ points to the directory “about-us” inside the root directory (/). When pointing to another directory without explicitly specifying the document, web servers typically return the document “index.html” inside that directory.
HTML 5 Notes For Professional – Chapter – 5 (Text Formatting)
While most hypertext markup language tags are accustomed to produce components, hypertext markup language conjointly provides in-text format tags to use specific text-related designs to parts of the text. This topic includes examples of HTML text formatting such as highlighting, bolding, underlining, subscript, and stricken text.
HTML 5 Notes For Professional – Chapter – 4 (Paragraphs)
<p>: Defines a paragraph
<br>: Inserts a single line break
<pre>: Defines pre-formatted text
Paragraphs are the most basic HTML element. This topic explains and demonstrates the usage of the paragraph element in HTML.
HTML 5 Notes For Professional – Chapter – 3 (Headings)
HTML provides not only plain paragraph tags but six separate header tags to indicate headings of various sizes and thicknesses. Enumerated as heading 1 through heading 6, heading 1 has the largest and thickest text while heading 6 is the smallest and thinnest, down to the paragraph level. This topic details the proper usage of these tags.