Web Front end engineer Face question

Source: Internet
Author: User

[HTML && css]--from Baidu Library

1. Doctype? Strict and promiscuous modes-how do you trigger these two patterns to differentiate between them?

Doctype

The declaration is in the first position in the document, before the label. This tag tells the browser which HTML or XHTML specification to use for the document.

The tag declares three DTD types, each representing a strict version, a transition version, and a framework-based HTML document.

When browser vendors start to create a standard-compatible browser, they want to ensure backward compatibility. To achieve this, they create

Two rendering modes are built: Standard and promiscuous (quirks mode). In standard mode, the browser renders the page according to the specification;

In promiscuous mode, the page is displayed in a more relaxed backward-compatible manner. Promiscuous mode typically simulates an old-fashioned browser such as Microsoft IE 4 and

Netscape Navigator 4) behavior to prevent old sites from working. Browser based on whether DOCTYPE exists and what kind of DTD is used

To select the rendering method to use. If an XHTML document contains a form-complete doctype, it is generally rendered in standard mode. For

HTML 4.01 documents, doctype that contain strict DTDs, often result in the page being rendered in standard mode. DOCTYPE that contains the transition DTD and URI

It also causes the page to render in standard mode, but having a transition DTD without a URI causes the page to be rendered in promiscuous mode. DOCTYPE does not exist or is not in the correct form

Causes HTML and XHTML documents to be rendered in promiscuous mode.

2. What are the inline elements? What are block-level elements? CSS box model?

In-line elements are:

A b span I b em img Input Select strong

Block-level elements are:

Div ul ol li DL DT DD H1 H2 H3 H4...P

Box Model:

Margin Border padding width

3. What are the ways CSS is introduced? The difference between link and @import is

1. Using the link tag

Write style rules in

. css in the style file, and then introduced with the <link> tag.

<link rel=stylesheet type= "text/css" href= "Example.css" >

2. Using @import to introduce the link method is very similar, but must be placed in <STYLE>...</STYLE>

<style type= "Text/css" >

<!--@import URL (css/example.css); -

</STYLE>

3. Write the style rules in the <STYLE>...</STYLE> tab using the Style tab.

<style type= "Text/css" >

<!--

Body {color: #666; background: #f0f0f0; font-size:12px;}

td,p {color: #c00; font-size:12px;}

-

</STYLE>

4. Use the Style property to add the style attribute directly to the individual component label,< element (label) style= "Nature (attribute) 1:

Set value 1; Property (Attribute) 2: Set value 2; ...}

5. Introducing styles Using <span></span> tags

<span style= "font:12px/20px #000000;" >cnwebshow.com</span>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.