Introductory HTML and JavaScript
Doctypes
Doctypes refers to a declaration that’s usually put at the start of an HTML document, it’s meant to tell the browsers what version of HTML this document uses.
With HTML 5 this became much easier, as before you had to put lots of text depending on what version or HTML or XML you are using, but with version 5 the only thing you have to put is <!DOCTYPE html>
and that’s it.
Commenting
Commenting is the act of turning some code or text into a comment, making it a comment makes the browser ignore it, as comments (as the name suggests) are things meant for the developer, like reminders or explanations or a todo lists and so on.
You can start a comment in HTML using the <!--
tag, and to close it (to prevent your entire code from becoming a comment) you can use -->
.
ID Attribute
You can give any HTML element an id attribute, and it’s used so you can tell different elements with the same name apart. No two elements on the page can have the same ID, that can be achieved using the Class Attribute.
Class Attribute
This is the same as ID Attributes, just that you can add the same class to different elements, this allows you to style (in CSS) different elements all at once, even if those elements have different names.
Block Elements
Block elements always start a new line when they are rendered into the page, some tags have this behavior by default, for example the <p>
tag or the <h1>
tag have this behavior by default.
Inline Elements
These elements are different than block elements in that they don’t start a new line when they are rendered, instead they just continue in the same line the previous element was on, hence the name.
Escape Characters
There are some characters that are used in and reserved by HTML code. (For example, the left and right angled brackets).
But what if you want to use them? then what’ll have to do is use what’s called escape characters.
Previously you had to input something akin to an id to that character, like if you wanted to write <
in text you’d have to write <
, or if you wanted to write a quote '
in strings you’d have to write ‘
, but nowdays that’s not needed, you simply have to write a Backslash \
and then write whatever character you need to write.
201 | Go back Home |
---|---|
read## | Name and Link |
read01 | Introductory HTML and JavaScript |
read02 | HTML Text, CSS Introduction, and Basic JavaScript Instructions |
read03 | HTML Lists, CSS Boxes, JS Control Flow |
read04 | HTML Links, CSS Layout, JS Functions |
read05 | HTML Images; CSS Color & Text |
read06 | JS Object Literals; The DOM |
read07 | HTML Tables; JS Constructor Functions |
read08 | More CSS Layout |
read09 | Forms and JS Events |
read10 | Debugging |
read11 | Audio, Video, Images |
read12 | Docs for the HTML <canvas> Element & Chart.js |
read13 | Local Storage |
read14 | |
read15 |