In html, how does one remove spaces to solve the white space on the browser ?, Remove white space

Source: Internet
Author: User

In html, how does one remove spaces to solve the white space on the browser ?, Remove white space

Today, I encountered a compatibility problem during graph cutting. I was lucky to finally solve this problem through the article by instructor Zhang Jinxin! However, when I was reading instructor Zhang's article, I couldn't understand what I wanted. I couldn't find the answer I wanted after I checked it online. Later I thought about it for a long time, now I want to write down my ideas. If something is wrong, you must point it out.

(Example 1 ):

This is an example code in instructor Zhang's article. The structure of the Code is that a div contains three a elements, each of which occupies one line. Therefore, when displayed on a browser, there is a gap between elements,

So there is a problem! Change the Code as follows (Example 2 ):

The final result is as follows,

The spacing between elements a disappears! Why do some minor changes in the Code produce different results? This puts me in a deep sense of thinking ...... @-@!

I understand this as follows: In the code in Example 1, the spacing between element a and element a is the distance between the element and the element, and the browser displays a blank space, the reason for the white margin between elements is the space between the tag segments. Therefore, remove the spaces in HTML and the natural spacing is fixed." Convert the perspective to Example 2. In the image, see the following:

There is a blank part between the code and the code, but the blank part is the distance between the element and the content (Element a and its content) it is not the white space between elements mentioned in the article by Mr. Zhang. Therefore, the white space will not be displayed in the browser. So? Some minor changes in the Code may help you solve big problems! In the above example, the spacing between elements and content is changed to the spacing between elements and content, which helps me solve the compatibility problem!

The above is what I learned today. Of course, my understanding may be wrong, but if you have different ideas, you must come up with them! Comments ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.