CSS Layout - The display Property

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Note:

Setting the display property of an element only changes how the element is displayed, NOT what kind of element it is.

display: none; is commonly used with JavaScript to hide and show elements without deleting and recreating them.

The (<)script(>) element uses display: none; as default.

The display property is the most important CSS property for controlling layout.

The display property specifies if or how an element is displayed.

Hiding an element can be done by setting the display property to none.

The element will be hidden, and the page will be displayed as if the element is not there:

As mentioned, every element has a default display value. However, you can override this.

Changing an inline element to a block element, or vice versa, can be useful for making the page look a specific way, and still follow the web standards.

visibility:hidden; also hides an element.

However, the element will still take up the same space as before. The element will be hidden, but still affect the layout:

Examples of block-level elements:

(1) (<)div(>) (2) (<)h1(>)- (<)h6(>) (3) (<)p(>) (4) (<)form(>) (5) (<)header(>) (6) (<)footer(>) (7) (<)section(>)

Examples of inline elements:

(1) (<)span(>) (2) (<)a(>) (3) (<)img(>)


Ensembles d'études connexes

NUR 3420 Pharmacology PrepU Chapter 34, Pharm: Chapter 34 therapy for fluid volume, 32: Drug Therapy for Fluid Volume Excess, Chapter 34: Drug Therapy for Fluid Volume Excess, Chapter 34: Drug Therapy for Fluid Volume Excess, 28: Drug Therapy for Hyp…

View Set

Worksheet 2: Two Houses of Congress

View Set

Hesi Final Review from Spring 2016

View Set

Chapter 8 - Managing Change and Innovation

View Set

Networking with TCP/IP Midterm 1

View Set

Econ 212 Chapter Review Question

View Set

The Heart - Lecture Practice Test

View Set

Saunders Musculoskeletal - 64, 65, 43

View Set