Summary of HTML element attribute testing (continuation)_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:45:07
Original
800 people have browsed it


HTML element attribute test summary (continuation)


The meaning (semantics) of the code element is "code content" , when FireFox renders the element, it will display the code tag content as a "monoswidth font" (the width of each character is equal), which causes the semantics and presentation form of the element to be mixed together; the correct approach is: the browser The legacy default rendering of code elements (monospaced font) for historical reasons should be ignored.

Semantic elements only describe the structure and meaning of the document content. For example, code represents the code in the document; video represents the video in the document; use CSS to control the form in which these elements are presented to the user (use the content of the code element with etc. Wide font is presented to the user), which achieves the separation of content and presentation. Regarding this, Chrome does a slightly better job than FireFox, for example, for the following document:


<!DOCTYPE html><html lang="en">    <head>                <meta http-equiv="Content-type" content="text/html;charset=utf-8" />                <title>XssPayloadTest</title>        </head>        <body >         <div>            this is normal textNode<br>            <code>this is normal textNode include in code element</code>        </div>        </body></html>
Copy after login


The rendering effects of the two are as follows:






source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!