The problem of white space caused by element wrapping_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:05:52
Original
1516 people have browsed it

(1) Two elements, one of which is a block-level element, will definitely wrap. After the line wraps, there will be a blank gap line between the upper and lower elements
(2) Both are inline elements, but If the width of the inline element exceeds the width of the parent element, it will automatically wrap. After the line wraps, there will be a blank gap line

between the upper and lower elements. I want to know the cause and solution of this blank gap line. Can any expert I know, I'd be very grateful if you could explain it to me.


Reply to discussion (solution)

should be the browser's default style.
Firebug observes the style of elements?
Generally reset the style sheet at the beginning of css, add margin:0;padding 0; or something like that, and remove the default margin and padding

In fact, problems like this can be completely avoided. The biggest headache is knowing it You can't just do it
1) Since the effect is no longer displayed in one row, you can use two block-level elements, or set the width after floating
2) If the child exceeds the parent, it itself There are compatibility issues, and the parent will be opened under IE6. You can set overflow:hidden

In addition, elements displayed as diplay:inline-block; will be displayed in the same row, and the code line breaks will be parsed. It is the so-called blank gap. There is no solution, it is floating. You can understand floating as an upgraded version of diplay:inline-block;

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!