In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the matters needing attention in writing Web front-end code, which is very detailed and has a certain reference value. Friends who are interested must read it!
1. It's best to add a sentence similar to the html tag before it.
Code that conforms to a set of W3C standards, which varies from person to person.
The advantage of using this standard is that you no longer have to worry about the different layout of websites in different browser environments. After using the standard, the author tested it in IE8, FF and Safari browsers, and the results showed that the page was normal. In addition, it is found that some bug including IE itself no longer appears after using the standard, such as IE default div box height is greater than the font height of bug, after following the standard will no longer appear.
One thing to note after following this standard is that some non-standard code may not work properly. For example, in javascript, there is the code of roll1right [XSS _ clean] = roll1left [XSS _ clean];, where roll1right and roll1left are the id of two different div on the web page. The web page can work without applying this standard, but this statement appears bug under the W3C standard. The reason is that the W3C requires all variables to be explicitly assigned, so you must precede the statement with a statement of var roll1right = document.getElementById ("roll1right");, and then the code all works fine.
2. When using div and table in the web page, it is found that although the border, margin and padding of div and table can also be set to 0 through css, while the div display is normal, there will still be some gaps in table. After querying W3CSchool, it is found that table has two attributes: cellpadding and cellspacing, in which the cellpadding attribute specifies the white space between the edge of the cell and the content, while the cellspacing attribute specifies the white space between the cells. So the cellpadding and cellspacing properties of the table in the web page are set to 0, and sure enough, there is no gap in the table of the web page, and the problem is solved.
These are all the contents of this article entitled "what are the considerations for writing Web front-end code?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.