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

What are the skills of CSS page layout

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the relevant knowledge of "what are the skills of CSS web layout". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, if in doubt, test immediately.

A lot of headaches can be saved if you can simply detect the original code when something goes wrong. The W3C has detection tools available for both XHTML and CSS, see http://validator.w3.org. Please note that errors at the beginning of the file may cause more errors due to improper structure and other factors; we recommend that you correct some of the most obvious errors and then re-detect them, which may reduce the number of errors.

Remember to clear the instruction properly when using the floating function

Floating is a dangerous feature that may not produce the results you expect. If you encounter a border where a floating element extends to the outer container or other irregularities, make sure you are doing the right thing.

Third, use padding or border to avoid boundary coincidence

You may be obsessed with space that should not be present at all, or you may not be able to squeeze out when you need a little space. If you use margin, it's easy to have boundary coincident.

Fourth, try to avoid specifying both padding/border and height or width for the element

IE for Windows often leads to computational problems with width and height. There are some ways to solve this problem, but if the parent element needs to specify the height and width, * * can apply margin to the child elements within the parent element, or padding to the parent element when the child element needs to specify the height and width.

Don't rely on min-width/min-height

IE for Windows does not support two grammars. But to some extent, IE for windows can achieve the same effect as min-width/min-height, so as long as you do some filtering on IE, you can achieve the results you want.

If in doubt, reduce the percentage first

Sometimes some errors will make 50% 50% become 100.1%, causing problems with the web page. At this point, try changing these values to 49% or even 49.9%.

Remember how to write "TRBL"

The abbreviated syntax of border,margin and padding has a specific order, starting from the top and turning clockwise: top,right,bottom,left. So the result of margin:0 1px 3px 5px; is borderless at the top, 1 pixel on the right, and so on. Remember "TRBL" and you won't get it wrong.

As long as the value is not zero, specify the unit.

This requires special attention, and many novice friends often ignore this problem. More than one emphasized the problem.

This is the end of the content of "what are the skills of CSS page layout". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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