Table of Contents
Reply to discussion (solution)
Home Web Front-end HTML Tutorial The problem of white space caused by element wrapping_html/css_WEB-ITnose

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

Jun 24, 2016 pm 12:05 PM
element newline blank gap

(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;

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to deal with blanks when playing PPT slides How to deal with blanks when playing PPT slides Mar 26, 2024 pm 07:51 PM

1. Open the PPT file you created and select the second slide. 2. On the second slide, select one of the pictures, and then select [Animation] to add any animation effect. 3. In the start column of the animation bar, change [While Standalone] to [After Previous Animation], and you will see that the picture animation label [1] will change to [0]. Do the same for subsequent slides, and you can see the effect by playing the slide at the end.

How to wrap lines in BarTender - How to wrap lines in BarTender How to wrap lines in BarTender - How to wrap lines in BarTender Mar 05, 2024 pm 07:52 PM

Many users use the BarTender software in their offices. Recently, some new users have asked how to wrap lines in BarTender. Below, the editor will bring you the method of wrapping lines in BarTender. Let us take a look below. 1. In BarTender, click the Create Text button in the toolbar, select Create Single Line Text, and enter the text content. 2. Double-click the created text object to open the text properties dialog box. Switch to the "Text Format" tab and select "Paragraph" for "Type" on the right. 3. Click Close, adjust the size of the text box or enter more text, or wrap the text according to actual requirements.

How to wrap rows in excel table How to wrap rows in excel table Feb 09, 2024 pm 02:00 PM

In the process of using Excel, we have to perform many different operations. Sometimes we need to wrap a line in a cell. So what exactly do we need to do to wrap a cell? Let’s take a look at how to wrap lines in a computer excel table. [Collection of excel table operation methods] How to wrap rows in excel table? Answer: You can do this by automatically wrapping rows and setting cell formats. 1. Automatic line wrapping 1. We select the area that needs to be wrapped in the table and click [Automatically wrap] on the [Start] page; 2. Then we adjust the width of column A to an appropriate value; 2. Set the cells Format 1. First, we select the area that needs to be wrapped, right-click the mouse, and click [Set Cell Format]; 2. Then in the pop-up

How to wrap cells in Excel on Apple computers How to wrap cells in Excel on Apple computers Feb 18, 2024 pm 08:39 PM

Wrapping lines in cells in Apple's Excel Apple's Excel software is a powerful spreadsheet tool that provides many convenient functions to help users with data processing and analysis. When using Excel, sometimes we need to enter multiple lines of text in cells to better organize and present the data. However, since Excel for Apple computers is slightly different from the Windows version of Excel, the method of wrapping lines is also different. In the Windows version of Excel, we can directly

C++ program: add an element to an array C++ program: add an element to an array Aug 25, 2023 pm 10:29 PM

An array is a linear sequential data structure used to hold homogeneous data in contiguous memory locations. Like other data structures, arrays must have the ability to insert, delete, traverse, and update elements in some efficient way. In C++, our arrays are static. C++ also provides some dynamic array structures. For a static array, Z elements may be stored in the array. So far we have n elements. In this article, we will learn how to insert elements at the end of an array (also known as appending elements) in C++. Understand the concept through examples. The usage of ‘this’ keyword is as follows: GivenarrayA=[10,14,65,85,96,12,35,74,69]Afterin

CSS transformation: how to achieve the rotation effect of elements CSS transformation: how to achieve the rotation effect of elements Nov 21, 2023 pm 06:36 PM

CSS transformation: How to achieve the rotation effect of elements requires specific code examples. In web design, animation effects are one of the important ways to improve user experience and attract user attention, and rotation animation is one of the more classic ones. In CSS, you can use the "transform" attribute to achieve various deformation effects of elements, including rotation. This article will introduce in detail how to use CSS "transform" to achieve the rotation effect of elements, and provide specific code examples. 1. How to use CSS’s “transf

How to wrap line on iPhone? How to set line wrap on iPhone? How to wrap line on iPhone? How to set line wrap on iPhone? Mar 22, 2024 pm 06:50 PM

1. Press the space bar multiple times, move the cursor to the far right, and then enter text to wrap the line. 2. When you need to break a line, click the microphone icon on the keyboard and the voice will say [Line break]. 3. In the memo usage scenario, there is a [Line Break] option in the input method, which can be used to achieve line break by copying. 4. Download other third-party input methods from the app store to use.

In JavaFX, what are the different path elements? In JavaFX, what are the different path elements? Aug 28, 2023 pm 12:53 PM

The javafx.scene.shape package provides some classes with which you can draw various 2D shapes, but these are just primitive shapes like lines, circles, polygons and ellipses etc... So if you want to draw complex For custom shapes, you need to use the Path class. Path class Path class You can draw custom paths using this geometric outline that represents a shape. To draw custom paths, JavaFX provides various path elements, all of which are available as classes in the javafx.scene.shape package. LineTo - This class represents the path element line. It helps you draw a straight line from the current coordinates to the specified (new) coordinates. HlineTo - This is the table

See all articles