webtechlearningchd
2,079 views
7 slides
Feb 16, 2016
Slide 1 of 7
1
2
3
4
5
6
7
About This Presentation
In this Presentation Block and Inline Elements explained completely..
Size: 459.66 KB
Language: en
Added: Feb 16, 2016
Slides: 7 pages
Slide Content
HTML Elements Block & Non-Block (In-Line) Level Elements
Description Every HTML element has a default display value depending on what type of element it is. The default display value for most elements is block or inline.
Block-level Elements A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can ). A block-level element is an HTML element that begins a new line on a Web page, and extends the full width of the available horizontal space of its parent element . Can have margins and/or padding If no height is set, will expand naturally to fit its child elements (assuming they are not floated or positioned ). By default, will be placed below previous elements in the markup (assuming no floats or positioning on surrounding elements)
Example Block-level Elements <p> , <div> , <form> , <header> , < nav > , < ul > , < li > , and <h1> .
Inline & Non-Block Elements An inline element does not start on a new line and only takes up as much width as necessary . Flows along with text content . Will ignore top and bottom margin settings, but will apply left and right margins, and any padding Will ignore the width and height properties If floated left or right, will automatically become a block-level element, subject to all block characteristics
Examples of Inline Elements: <a>, <span>, <b>, < em >, < i >, <cite>, <mark>, and <code>.