Friday, July 3, 2015

a) What are the possible values for the display attribute that are supported by all browsers? b) What is the default value for the display attribute for the image element? (what is the difference between inline and block level elements) c)What does display: run-in do? d) Difference between “visibility:hidden” and “display:none”? What are the pros and cons of using display:none?



a)main values: none, block, inline, list-item, run-in
all values: inline | block | list-item | run-in | compact | marker | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit
b) default value: inline, block or list-item, depending on the element. The
is an inline element.
c)Run-in should make the run-in element be the first line of the next sibling block level element, if it is before a block level element that is not floated or absolutely positioned. If the next sibling is positioned or floated, then the run-in element will be a block level element instead of appearing in-line.
d) PPK’s Quirksmode explains it well. The w3schools lists table display values.
When visibility is set to hidden, the element being hidden still occupies its same place in the layout of the page. If the display is set to none, the element does not occupy any space on the page — as if it didn’t exist..

No comments: