webmonkey

 

display

Page history last edited by Ryan M. 2 yrs ago

Definition

 

The display property sets how/if an element is displayed.

 

Inherited: No

JavaScript Syntax

 

CSS properties can also be dynamically changed with a JavaScript.

 

Scripting Syntax: object.style.display="none"

 

In our HTML DOM tutorial you can find more details about the display property.

 

In our HTML DOM tutorial you can also find a full Style Object Reference.

Example:

p

{

display: block

}

 

li

{

display: list-item

}

 

table

{

display: table

}

 

td, th

{

display: table-cell

}

!

Example:

 

!!! CSS Code:<pre class="code">a { display: block; }</pre><pre class="code">p { display: inline; }</pre><pre class="code"> </pre>

!!! HTML Code:<pre class="code"><a href="http://www.tizag.com/" target="_blank">Tizag.com - Learn to Whip the Web<br /></a><br />...<br /><a href="http://www.tizag.com/" target="_blank">Tizag.com - Learn to Whip the Web<br /></a><br /><br /><br /><p>These paragraph </p><br /><p>elements</p><br /><p>have been </p><br /><p>inlined.</p></pre>

 

 

Result:

Tizag.com - Learn to Whip the Web

Tizag.com - Learn to Whip the Web

Tizag.com - Learn to Whip the Web

Tizag.com - Learn to Whip the Web

Tizag.com - Learn to Whip the Web

 

These paragraph

 

elements

 

have been

 

inlined.

 

Comments (0)

You don't have permission to comment on this page.