CSS Playlist
• CSS Tutorial for Beginners
HTML Playlist
• Html tutorial for beginners
Sign up for my newsletter to receive weekly updates
http://bit.ly/2RRFktj
Join our facebook page
bit.ly/2OKQYV7
CSS Display
The display property is the most important CSS property for controlling layout.
The Display Property
The display property specifies if/how an element is displayed.
Every HTML element has a default value depending on what type of element it is. The default display value for most element is block or inline.
Block level Element
A block-level element always starts on a new line and takes up full width available (stretches out to the left and right as far as it can).
Examples
div, h1-h6, p, form, header, footer, li, section
Inline Element
An inline element does not start on a new line and only takes up as much width as necessary.
Examples
span, a, img
Display None
Display:none; is commonly used with Javascript to hide and show elements without deleting and recreating them.
Take a look at our first example
Override the default display value
As mentioned, every element has a default 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.
A common example is making inline li elements for horizontal menus.
Note: Setting the display property of an element only changes how the element is displayed, not what kind of element it is. So, an inline element with display: block is not allowed to have other block level inside it.
Hide an element – Display: none or visibility hidden
Hiding an element can be done by setting the display property to be none. The element will be hidden, and the page will be displayed as if the element is not there.
----------------------------------------------------------------------------------------------------------------
#LearnWebTechnologies #CSS #CSSTutorialForBeginners