Html Course


HTML Paragraphs

Paragraphs are defined with the <p> ... </p> tag.
Paragraphs may contain text and inline elements. They are block elements, but they may not contain other block elements, including other paragraphs.
The length of the displayed text will be adjusted by the opening size of the browser.
Browsers automatically add an empty line before and after a paragraph, so, the distance between two successive paragraphs is of two lines.


- Example:
<!DOCTYPE html>
<html>
<head>
<title>Document Title</title>
</head>
<body>
<h4>Example Paragraphs</h4>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
<p>Paragraph 4</p>
</body>
</html>

Line Breaks - <br>

The <br> tag inserts a line break in the content, it allows you to control where to add new line breaks, to force the beginning of a new line at a particular poinnt.

- Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Be Happy</h1>
<p>The Peace is Good.<br>
Line 2<br>
Line 3<br>
... </p>
<p>The smile brings joy.</p>
</body>
</html>
- <br> is an empty element, but may contain attribute (id, class, style).
Example:
<br id="idb">

Horizontal rule - <hr>

The <hr> tag creates a horizontal line in an HTML page.
The <hr> element can be used to divide a web page into different horizontal areas.
The <hr> tag is a block level element, and it uses the standard attributes: id, class, style.
With the CSS background proerty you can define the line color, and with the height property you can set the line thickness.


- Example:
<!DOCTYPE html> 
<html> 
<head>
<title>Document Title</title>
</head>
<body>
<h1>Page Title</h1>
<p>Paragraph 1<br>
Line 2<br>
Line 3<br>
... </p>
<hr>
<hr style='background:#1111fe; height:3px; width:50%;'>
<p>Paragraph 2</p>
</body>
</html>

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which meta tag provides a short description of the page?
<meta content="..."> <meta description="..."> <meta http-equiv="...">
<meta name="description" content="70-160 characters that describes the content of the page" />
Which CSS property is used to stop the wrapping effect of the "float"?
clear text-align position
#some_id {
  clear: both;
}
Click on the method which gets an array with all the elements in the document that have a specified tag name.
getElementsByName() getElementById() getElementsByTagName()
var divs = document.getElementsByTagName("div");
var nr_divs = divs.length;
alert(nr_divs);
Indicate the PHP function which returns the number of elements in array.
is_[) count() strlen()
$arr =[7, 8, "abc", 10);
$nri = count($arr);
echo $nri;        // 4
Paragraphs, Line break, Horizontal rule

Last accessed pages

  1. Simple Admin Login PHP Script (10894)
  2. jQuery parent, children and nth-child() (13826)
  3. Display UL bullets and OL numbers on the right side (8088)
  4. Convert BBCode to HTML and HTML to BBCode with JavaScript (9298)
  5. jsSHA - SHA Hashes and HMAC in JavaScript (3445)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (201)
  2. Read Excel file data in PHP - PhpExcelReader (66)
  3. The Mastery of Love (56)
  4. PHP Unzipper - Extract Zip, Rar Archives (51)
  5. Working with MySQL Database (34)
Chat
Chat or leave a message for the other users
Full screenInchide