Several questions of web development

Source: Internet
Author: User
Tags closing tag html header

1. What is HTML
Hypertext Markup Language, or HTML (Hypertext Markup Language), is a markup language used to describe a Web page document.

2, <! DOCTYPE the function and usage of HTML header file

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

XHTML specification. The tag declares three DTD types, which represent strict, transitional, and framework-based HTML documents, respectively.

。 There is no end tag.

3, the role of meta-elements (at that time is the choice of questions, the options are not clear)
The meta element is invisible to the visitor (unless parsing the HTML source file), which is visible to the browser and some search engines to

Describe document properties, which means that search engines can be more easily searched for.

4, a large number of super-simple HTML and CSS selection questions, a little bit basic people can be selected in 5 seconds

5, CSS code optimization. (Give a bunch of repetitive CSS code, let you abbreviate)
margin-top:20px;
margin-right:5px;
margin-left:5px;
margin-bottom:20px;
Font-style:italic;
Font-variant:small-caps;
Font-weight:bold;
Font-size:1em;
line-height:140%;
font-family: "Lucida Grande", Sans-serif;
Color: #336699;

Answer:
margin:20px 5px;
Font:italic small-caps Bold 1em/140% "Lucida Grande", Sans-serif;
Color: #369;
If the interviewer asks you, why do you want to optimize it? A: Reduce page requests and CSS parsing times, improve page response speed.

6. Test {
height:25px;
line-height:25px;
}
Q: Does this code show the same height in IE and Firefox? If not, write down their actual height.

Answer: (Do not "write their actual height" this hint of when)
This problem is test compatibility, you just write, ie browser is the content of the open height, such as the text height is 30, then the height of the final IE

is 30. And the Firefox browser is content one surpasses the height, the height will be bursting, causes the dislocation.

If this topic allows you to solve the compatibility, you can use Min-height method plus Csshack (IE6 don't know min-height) to solve

Summary

7. What is the difference between ALT and title in IMG?

1. Different meanings
Alt is the alternate text when the picture does not exist; Title is a description of the picture and further explanation

2. Different performance in the browser
In Firefox and IE8, the title value is displayed when the mouse passes through the picture, and the Alt value is not displayed; Only in IE6, when the mouse has been

The values for title and Alt are displayed when the picture is in. For website SEO optimization, title and Alt are also the most important point: search engine on

The meaning of the image is judged mainly by the ALT attribute. So in the image alt attribute is described in brief text, also contains keywords, also the page

Part of the optimization. If the condition permits, you can further describe the picture in the title attribute.

8. Enumerate the line elements and block elements in the HTML (don't write it all, unless the interviewer is really harsh)
Block: Address blockquote center dir div DL fieldset form h1-h6 hr Isindex input prompt
Menu Noframes frames ol P PRE Table UL applet button del iframe ins map Object-

Object Script
Line: A abbr acronym b BDO big BR cite code DFN EM font i img input kbd label
Q s SAMP Select small span strike strong sub SUP textarea TT u var

9, Div and span of the difference (I was the feeling is, just test over the line and block, how again, so write some application of the difference)

DIV: Defines a partition or section in a document that can be divided into separate, distinct parts. It can be used as a strict organizational tool and is not associated with any format. If tagged with an id or class, the label will become more effective.

Span:span does not occupy a single line, the content is the width, span is how wide. Typically used to mark elements in a paragraph, specifying specific CSS code

10. &nbsp;&nbsp; Do you really know html? &nbsp;&nbsp; I said: Yes, I know very well (well, very good, the legend of a lot of people have been hanging off the topic really was I met ~ Fortunately I looked before, all down, then 100% correct)

The difference between 1:html and XHTML at the test centers
This line of code is completely correct under HTML 4.01 strict, which is a bunch of errors under XHTML 1.0 Strict. So it's obviously a test-taker. Under XHTML all tags are closed, p,br need to be closed, labels are not uppercase, p is lowercase. Both nbsp and BR must be included in the container. These are not errors under HTML. P is an optional closing tag in HTML, which can be used without closure. This test center tells you how harsh XHTML is. This is the basic test, correct, you still can't get full marks.

Test Center 2: Style separation
It is unreasonable to control the indentation with a. should be done with CSS.

Test Center 3: Fair use of labels
BR is a forced wrap label, p is a paragraph. The original problem with a continuous BR manufacturing two paragraphs of the effect, the effect is achieved, but obviously with unreasonable, paragraph spacing can not be controlled later. The correct approach is to use two p to represent two paragraphs. "I said" back is normal text folding line with BR is reasonable.

11. What if you let a flash float above a div?
Add this property to the flash tag wmode= "opaque" or wmode= "transparent" to make flash transparent, the upper layer is the flash layer is a div, so that can overlap together, because flash transparent, so do not affect the following div display.

(if the title is upside down, let you float the div to flash, then use absolute positioning and Z-index attributes)

12. What do you think is the hardest part of HTML? (interviewer after interview with me, said his intention is to understand you in the web and development, you think which piece is the hardest, the most difficult to deal with)

My answer is to solve the compatibility of each browser will affect my productivity, this is I think the most difficult to deal with a trivial matter, but I say that I can finally solve all browser compatibility, usually I first check the layout is wrong, if the layout is error-free, use a small number of CSS hack code to compatible with all browsers, The interviewer has been nodding, without rebuttal.

Copyright notice: I feel like I'm doing a good job. I hope you can move your mouse and keyboard for me to order a praise or give me a comment, under the Grateful!_____________________________________________________ __ Welcome reprint, in the hope that you reprint at the same time, add the original address, thank you with

Several questions of web development

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.