1. It is best to add a sentence like this before the html tag <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > The code indicates that a certain set of W3C standards are followed. The specific set of standards used varies from person to person. The advantage of using this standard is that you no longer have to worry about different website layouts in different browser environments. After using this standard, the author tested it in IE8, FF, and Safari browser environments, and the result page display was normal. In addition, it was found that after using this standard, some bugs in IE itself no longer appeared. For example, the bug that the height of the div box in IE defaults to be greater than the font height no longer appeared after following this standard. One thing to note when following this standard is that some non-standard code may not work properly. For example, in JavaScript there is the code roll1right.innerHTML = roll1left.innerHTML;, where roll1right and roll1left are the IDs of two different divs on the web page. The web page can work without applying the standard, but this statement will have a bug under the W3C standard. The reason is that W3C requires that all variables have clear assignments, so you must add the statement var roll1right = document.getElementById("roll1right"); before this statement, and then the code will work properly. 2. When using div and table in a web page, I found that: although the border, margin, and padding of div and table can be set to 0 through CSS, the table will still have a certain amount of space while the div displays normally. After searching W3CSchool, I found that table has two attributes: cellpadding and cellspacing. The cellpadding attribute specifies the space between the cell edge and the content, while the cellspacing attribute specifies the space between cells. So I set the cellpadding and cellspacing properties of the table on the web page to 0. Sure enough, there was no gap between the tables on the web page, and the problem was solved. |
<<: Vue implements mobile phone verification code login
>>: The difference between div and span in HTML (commonalities and differences)
WeChat applet uniapp realizes the left swipe to d...
Table of contents Preface 1. First completely uni...
1. From father to son Define the props field in t...
Downloaded an es image from docker hub, version 6...
This article example shares the specific code of ...
Table of contents Preface Jump to APP method URL ...
CSS scroll bar style modification code .scroll::-...
In previous development, we used the default attr...
——Notes from "MySQL in Simple Terms (Second ...
Table of contents background analyze method backg...
Macrotasks and Microtasks JavaScript is a single-...
Code Sample Add a line of code in the head tag: XM...
Table of contents CSS3 Box Model a. CSS3 filter b...
1. Write a backup script rem auther:www.yumi-info...
Let’s look at the effect first: This effect looks...