display

With the display property you can specifies if or how an HTML element is displayed in the web page.
  - Values:   - Syntax:
  Example (remove a DIV, displays <a> tags as block elements and <li> with inline):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
 <title>display</title>
 <style type="text/css"><!--
 #idd { display: none; }
 .a_block { display: block; }
 #idu li { display: inline; }
 --></style>
</head>
<body>
 <div id="idd">Removed content.</div>
 <a href="http://coursesweb.net/css/" title="CSS course" class="a_block">CSS course</a> <a href="http://coursesweb.net/html/" title="HTML course" class="a_block">HTML course</a>
 <ul id="idu">
  <li>List 1</li>
  <li>List 2</li>
  <li>List 3</li>
 </ul>
</body>
</html>
  - Result:
CSS course
HTML course

visibility

The visibility property can control if an element is visible or not. Even if the element is hidden, still affects layout and will take up space on the web page, where it should to be displayed.
  - Values:   - Syntax:
  Example (make a <span> invisible):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
 <title>visibility</title>
 <style type="text/css"><!--
 #idd span { visibility: hidden; }
 --></style>
</head>
<body>
 <div id="idd">This row contains a text <span>in a SPAN tag</span> that is hidden but still takes up space.</div>
 </ul>
</body>
</html>
  - Result:
This row contains a text                     that is hidden but still takes up space.

Define the visible portion of an element

Defining the visible surface of an element determines its visible portion. The remaining contents of that element does not disappear, but is invisible to the visitor.
The element must have set position:absolute, then, to define the visible region it's used the clip property with rect value that sets the shape of the visible region.
  - Values:   - Syntax:
  Example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
 <title>clip</title>
 <style type="text/css"><!--
 #idd {
  position: absolute;
  clip: rect(0px, 200px, 23px, 60px);
 }
 --></style>
</head>
<body>
 <div id="idd">Free CSS: coursesweb.net/css/</div>
 </ul>
</body>
</html>
  - Result:
: coursesweb.net/

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which attribute is used in <a> tag for the address of the link?
src href rel
<a href="http://coursesweb.net/" title="CoursesWeb.net">CoursesWeb.net</a>
Which CSS property sets the type of the text font?
font-family text-decoration font-size
h2 {
  font-family:"Calibri",sans-serif;
}
What instruction selects all the <div> tags with class="cls"?
querySelector("div.cls") getElementsByTagName("div") querySelectorAll("div.cls")
var elm_list = document.querySelectorAll("div.cls");
var nr_elms = elm_list.length;       // number of selected items
alert(nr_elms);
Indicate the function that can be used to get the sum of values in an array.
array_sum() array_diff() array_shift()
$arr = array(1, 2, 3, 4);
$arr_sum = array_sum($arr);
echo $arr_sum;       // 10
Display and Visibility

Last accessed pages

  1. Get Attribute (ID, Class, Name, Title, Src) with jQuery (2770)
  2. CSS3 - text-shadow, word-wrap, text-overflow (58)
  3. PHP-MySQL free course, online tutorials PHP MySQL code (3204)
  4. Hide and Show simple effects (180)
  5. Rectangle, Oval, Polygon - Star (74)

Top accessed pages

  1. PHP-MySQL free course, online tutorials PHP MySQL code (3204)
  2. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (3086)
  3. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (3077)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (2770)
  5. PHP Chat Script (2514)