Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does HTML realize that the main content area is not centered on the left level?

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "HTML how to achieve the main content area does not rely on the left level center", in the daily operation, I believe that many people in the HTML how to achieve the main content area does not rely on the left level center problem, the editor consulted all kinds of data, sorted out a simple and easy-to-use method of operation, hope to answer "how to achieve the main content area does not rely on the left level center" doubt! Next, please follow the editor to study!

First, the advertisement of the question of high efficiency:

Check whether the font-family fancy attribute value of the equipment font in your CSS can be used in Chinese calligraphy. Such as: font-family: "Song style", font-family: "Microsoft Yahei", font-family: "boldface" and so on.

The problem is that your CSS font style setting equipment equipment font directly uses Chinese characters.

2. Line-height effective plan:

The conversion of the font to Chinese pen and ink is probably converted into English words encoded by Unicode or using the font. A

Often see some html pages in the form of the whole page is left, and in some browsers is in the middle, what is the reason for this incompatibility problem? How do you plan to be compatible with html in the middle of a non-browser?

The whole web page is on the left and some are in the middle, how to crack it is difficult

This html is not centered on the entire page, but on the left. The reason for the problem is that the outermost layer does not set the structure to center, and some set float:left, how it constitutes the entire page to the left rather than center.

1. Planning to use floats to cause html not to be centered

The outermost DIV uses float:left (center) or float:right (right), which makes up the entire html can not be centered very easy to operate, remove the outermost layer to use float, coupled with margin:0 auto can be compatible with major readers, the whole page will be centered in seconds.

The use of float causes the html page to be left, not centered.

Keep the outermost DIV in the center and realize the whole html in the center.

Note: the page should be centered, so the outermost DIV box object cannot use the float property, and set the equipment margin:0 auto to complete the entire html center, while the content of other DIV whether to use float floating will not affect the page center. The key is to set the outermost equipment in the middle.

A brief introduction to the conversion of Chinese to English or Unicode for the failure of bank height:

1. Song style

English: SimSun

Unicode code:\ 5B8B\ 4F53

2. Blackbody

English: SimHei

Unicode code:\ 9ED1\ 4F53

3. Microsoft Yahei

English: Microsoft YaHei

Unicode code:\ 5FAE\ 8F6F\ 96C5\ 9ED1

Then the CSS font setting equipment will be applied after conversion:

Body {font-family: "Microsoft Yahi"} so far, the study on "how to achieve the center of the main content area without the left level in HTML" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report