Html Course


What is HTML? (Hypertext Markup Language)

- It is a logical set of codes that constitues the appearance of a web document and the information contained. The codes are written in '<' (open bracket) and '>' (closed bracket), although they are not really brackets, that is what they are called and look like: < >.

Example:
<BODY> or <DIV>
- Most elements (also named tags) have an element (tag) for opening and a closing element distinguished by '/' inside the brackets: '< >'.
Example:
<DIV> ... </DIV>
- The first word that appears inside the '<' is called element or HTML label and tells the browser what item to create; something like <DIV> (a block element).
- The words follow after that element inside '< >'are named attributes they describe the element's properties. Such as color, size, etc.
- Attributes are separated by spaces and followed by an equal sign '=', after which the attribute's values are written into quotes (' ').
- Thus, a HTML label may contain the identifier, attributes and values.
- In the following example, DIV is the element, style is the attribute and 'color;blue;' is the value:
<DIV style='color:blue;'>This text will be blue</DIV>

HTML Document Structure

- A HTML document (file) consists of several elements and their attributes.
- At first a HTML element contains (surrounds ) the document's data. This element contains two main sub-elements HEAD and BODY. In HEAD you can add the webpage's title and other elements known as metatags, and also JavaScript scripts and CSS styles. In BODY you add the document's content which will be displayed on the webpage.

Example:
<!DOCTYPE html>
<html>
 <head>
 <title>Document Title</title>
 </head>
 <body>
 Webpage content
 </body>
</html>

The overall structure of a HTML document


<!DOCTYPE html>
<html>

    <HEAD> This one also has multiple sub-elements:
        <TITLE> Here write the title of the document, as suggestive as possible, and end it with </TITLE>
        <BASE> Can be used to record the location of the document in URL form. (Required if the document is not accessed in its original location). Ends with </BASE>
        <LINK> Indicates a relationship between the document and other objects on the WEB. Ends with </LINK>
        <META>  Here you write information such as the keypad (language) used, description and keywords that can be found by search engines. Ends with </META>
        <SCRIPT> Contains any JavaScript or VB script. Ends with </SCRIPT>
        <STYLE> Contains information about style, graphic on the content that will appear on the webpage. Ends with </STYLE>
    This is where the elements added in HEAD end
    </HEAD>
    <BODY> HTML labels and content of the document that are to be displayed on the website are included in this element. You can also add here elements such as: <SCRIPT> </SCRIPT>
Ends with
    </BODY>
    </HTML>

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add lists into <ul> and <ol> elements?
<dt> <dd> <li>
<ul>
 <li>http://coursesweb.net/html/</li>
 <li>http://coursesweb.net/css/</li>
</ul>
Which value of the "display" property creates a block box for the content and ads a bullet marker?
block list-item inline-block
.some_class {
  display: list-item;
}
Which instruction converts a JavaScript object into a JSON string.
JSON.parse() JSON.stringify eval()
var obj = {
 "courses": ["php", "javascript", "ajax"]
};
var jsonstr = JSON.stringify(obj);
alert(jsonstr);    // {"courses":["php","javascript","ajax"]}
Indicate the PHP class used to work with HTML and XML content in PHP.
stdClass PDO DOMDocument
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>';
$dochtml = new DOMDocument();
$dochtml->loadHTML($strhtml);
$elm = $dochtml->getElementById("dv1");
echo $elm->nodeValue;    // CoursesWeb.net
Basic HTML elements

Last accessed pages

  1. Date and Time in ActionScript 3 (10098)
  2. PHPMailer (2347)
  3. Break and Continue (2356)
  4. Uploading images to server with Ajax (6100)
  5. Convert BBCode to HTML and HTML to BBCode with JavaScript (9436)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (511)
  2. CSS cursor property - Custom Cursors (67)
  3. PHP-MySQL free course, online tutorials PHP MySQL code (48)
  4. The Mastery of Love (47)
  5. Read Excel file data in PHP - PhpExcelReader (43)