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 10 problems and skills that DIV CSS beginners must master?

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

Share

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

This article introduces 10 questions and skills that DIV CSS beginners must master. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

Describe to you 10 problems and skills that DIV CSS beginners need to pay attention to. DIV CSS beginners often feel that they have encountered a lot of inexplicable problems. Here are 10 problems and skills to review the past and learn the new.

CSS fundamentals: 10 problems and skills that DIV CSS beginners need to pay attention to

Check whether the HTML element is misspelled and if you forget the closing tag

Even veterans often get the nesting relationship of DIV wrong. You can use dreamweaver's verification function to check for errors.

Check whether the CSS is correct

Check to see if there are any spelling mistakes, if you forget the ending}, etc. You can use CleanCSS to check for spelling errors in CSS. CleanCSS is supposed to be a weight loss tool for CSS, but it can also check for spelling mistakes.

Third, determine the location of the error

If the error affects the overall layout, you can delete the DIV blocks one by one until the display returns to normal after deleting a DIV block to determine where the error occurred.

Fourth, use the border attribute to determine the layout characteristics of the error elements.

Accidentally laying out using the float attribute can lead to errors. At this point, add the border attribute to the element to determine the element boundary, and the cause of the error will be revealed.

5. The parent element of the float element cannot specify the clear attribute

Under MacIE, if you use the clear attribute on the parent element of the float element, the layout of the surrounding float elements will be confused. This is MacIE's famous bug. If you don't know it, you will take a detour.

6. The float element must specify the width attribute.

Many browsers have bug when displaying float elements that do not specify a width. So be sure to specify the width attribute for the float element, regardless of its content.

7. Float elements cannot specify attributes such as margin and padding.

IE has bug when displaying float elements that specify margin and padding. So do not specify the margin and padding attributes on the float element (you can set margin and padding by nesting a DIV inside the float element). You can also use the hack method to specify extraordinary values for IE.

The sum of the widths of float elements should be less than 100%.

If the sum of the widths of the float elements is exactly 100%, some old browsers will not display properly. So make sure the sum of the widths is less than 99%.

9. Has the default style been reset?

Some properties, such as margin, padding, etc., will be interpreted differently by different browsers. Therefore, * * set all margin and padding to 0, list style to none and so on before development.

Did you forget to write DTD?

If the results are different no matter how you adjust the display in different browsers, you can check to see if you forgot to write DTD at the beginning of the page.

About DIV CSS beginners must master 10 questions and skills are shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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