The written html is copied to the jsp file, and the margin center in ie6 is invalid. This problem is not found in pure html. Jsp is created using myeclipse (AdvancedTemplates). The generated DOCTYPE is as follows: & lt ;! DOCTYPEHTMLPUBLIC & quot;-// W3C // DTDHTML4.01...
The written html is copied to the jsp file, and the margin center in ie6 is invalid. This problem is not found in pure html. Jsp is created using myeclipse (Advanced Templates). The generated DOCTYPE is as follows:
The DOCTYPE in the html file created using editplus is as follows:
It is precisely because of the different DOCTYPE that the css margin center in ie6 fails.
Of course, sometimes we need to solve css compatibility issues in browsers, especially ie, we may choose css hack. Compared with css hack, it is easier to select the correct DOCTYPE to Implement css compatibility. As long as we select a proper DOCTYPE and css write standards, the chances of browser compatibility problems will be reduced.
Most of the DTD types in DOCTYPE currently use the Transitional type. Generally, this DOCTYPE will be used when you create HTML using specialized web page creation software.
However, the newly created JSP (AdvancedTemplate) page in myeclipse does not use this DOCTYPE (not specified by DTD), which may cause browser compatibility problems, to avoid this problem, we 'd better use a common format.
When we select Jsp (Basic Templates) when creating JSP in myeclipse, we can choose which template page to use. If this option is not found in the new item, click window-> Customize Perspective and select new under it. Select jsp (BasicTemplate) and click OK.
In this way, we can customize a suitable JSP template, and then use our own template when creating a new JSP.
Open preferences, expand JSP on the left-> JSP Template, click the new option in the window on the right to fill in the relevant information, and save it:
On the newly created JSP page, select JSP (Basic Template) and click next to select the JSP Template to be used, and then click finish. You do not need to select a template next time. The system will use the previous template.
The code for creating a JSP page is as follows:
[Html]
<% @ Page language = "java" import = "java. util. *" pageEncoding = "UTF-8" %>
Www.2cto.com
Insert title here
Author: jdluojing