Home >Web Front-end >HTML Tutorial >Under what circumstances should display: block be added to a div? _html/css_WEB-ITnose

Under what circumstances should display: block be added to a div? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:09:411435browse

I made an adaptive width navigation background using -moz-linear-gradient background. Why can’t it be displayed without adding display: block?


Reply to discussion (solution)

div is block by default, unless the default value is changed due to inheriting other styles, then according to Sometimes it may be necessary to explicitly specify block

display:none to hide
display:block to display

Generally, when designing to display ads or login pages on the page, it needs to be controlled in JS Visible properties of DIV.

display:none Hide
display:block Show

Generally, when designing to display advertisements or login pages on the page, you need to control the visible attributes of the DIV in JS.

The div is block by default, unless the default value is changed due to inheriting other styles. In this case, you may need to explicitly specify block as needed

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn