How do you understand how to leave white space on your browser by removing spaces in HTML?

Source: Internet
Author: User

Today in transduction, encountered a compatibility problem, very lucky finally through the Zhang Jinxin Teacher's article solved this problem! But in the reading of teacher's article, I have a place do not understand, in the internet did not find the next I want to answer, and then I think for a long time seems to be so, now I put my ideas out, if there is wrong place, we must point out oh.

(Case 1):

This is an example of a teacher in the article code, the structure of the code is a div consists of 3 a elements, each element of a is a row, so when displayed on the browser, a element between a gap,

So here's the problem! Change the code to this, (case 2):

The final result is this,

The spacing between a elements is actually gone! Why do some minor changes in the code produce a different result? This gave Virgo a deep thought of me ... @[email protected]!

I understand this: the code in case 1, the space between a element and a element is the distance between the element and the element, the final display in the browser blank, borrowed from the teacher in the passage of the article "The reason for the white space between the elements is the space between the tabs, so, remove the space in the HTML, The natural distance is wood. "Turn the perspective to Case 2, in the picture, as follows:

There is a blank part of the code and Code, but this blank part is the distance between the element and the content (a element and its contents), not the spacing between the elements and elements mentioned by teacher Zhang in the article, so there is no white space left in the browser. So Some minor changes in the code can help you solve big problems! As in the above example, the spacing between elements and elements becomes the space between the elements and the content, which helps me solve the compatibility problem!

The above is what I have learned today, of course, my understanding may be wrong, but if you have different ideas must be said Oh! Comments ~

How do you understand how to leave white space on your browser by removing spaces in HTML?

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.