正逢公司网站改版上线,由于经验的不足没有考虑到兼容之前浏览器的版本。
现在遇到如下问题:
http://example.liambaba.com/liambaba-laboratory/temp-dir/users_login_0...
http://example.liambaba.com/liambaba-laboratory/temp-dir/users_login_0...
大家可以看这两个页面的不同,是因为申明头部造成的。
我希望能详细的了解为什么,如果在这里你能慷慨的给出意见,对我来说是莫大的帮助~!
PHPz2017-04-17 11:33:32
The <!DOCTYPE>
reputation of the two main pages leads to different rendering modes. This results in a different user agent stylesheet loaded by the browser.
Taking Chrome as an example, the declaration of users_login_01.html
is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
, which will trigger Chrome to render in Standard mode. The corresponding <input>
tag is box-sizeing
. And content-box
mistakenly declares non-standard users_login_02.html
. Chrome will use Quirks mode for rendering, and the corresponding <!DOCTYPE>
is box-sizeing
. border-box
天蓬老师2017-04-17 11:33:32
The second solution of the poster was written incorrectly and should be <!DOCTYPE HTML> instead of <!DOCTYPE>. I checked the information and did not see such an abbreviation, so it was caused by the wrong writing of dtd. Mixed mode, resulting in box model errors.