Yahoo! interview questions-do you really know HTML?

Source: Internet
Author: User

If there is such an HTML section, please pick up the problem:

<P> & nbsp; Elder brother does not write HTML, but is lonely. <Br> & nbsp; I said: <br> don't be infatuated with brother. Brother is just a legend.

This was originally Yahoo!'s pen question (Text changed). It has been used for many years and no one has answered the question completely.
================= Answer part ==========================

The motivation for this question is that too many people think HTML is too simple, but it is exactly the most basic and important part of front-end development. Unreasonable HTML structure design directly affectsCodeIt is easy to maintain, inflexible, and related to web page performance and collaboration efficiency. Many people think that front-end development is Javascript development, which is a big mistake. Javascript, HTML, and CSS are the three basic pillars of front-end development. They are completely different in nature and closely related. Correct understanding of them and rational application are the differences between professional and non-professional. Some backend engineers can write beautiful JS files, but they really don't know how to reasonably combine JS, HTML, and CSS for application. Accurately grasp HTML.Programming LanguageIn this way, it is based on rich practical experience and experience, and is the basic skill of front-end engineers.

This is not a real question or a forced question. It is a basic skill to take an examination of the question of "Drawing eggs. Code, such as its own, can fully reflect its front-end development literacy.

Let's get down to the truth. Exam points for this question:

Test site 1: differences between HTML and XHTML
This line of code is completely correct under HTML 4.01 strict, and there are a bunch of errors under XHTML 1.0 strict. So it is obviously a test site. All tags in XHTML are closed. P and BR must be closed. The tags cannot be uppercase, and P must be lowercase. Both nbsp and BR must be included in the container. None of these errors in HTML. P is an optional closed tag in HTML.

This test site tells you how harsh XHTML is. This is a basic test point. You can get 60 points.

Test site 2: Test style separation
It is unreasonable to use nbsp to control indentation. CSS should be used to do this. Therefore, nbsp should be deleted.

Test site 3: Use tags properly
The BR is a forced line label, and the P is a paragraph. The original question uses a continuous Br to create two paragraphs. The effect is achieved, but it is obviously unreasonable to use it, and the paragraph spacing cannot be controlled later. The correct method is to use two P to represent two paragraphs. "I said" it is reasonable to use the BR to fold the text below.

If you get all the correct answers, you will get 100 points.

Improvement results for the original question:
In HTML 4.01:

<P> brother wrote not HTML, but lonely. <P> I said: <br> don't be infatuated with brother. Brother is just a legend.

XHTML 1.0:

<P> brother wrote not HTML, but lonely. </P> <p> I said: <br/> don't be infatuated with brother. Brother is just a legend. </P>

Plus points: Use semantic tags reasonably
Semantic tags are used reasonably on the basis of the above to mark the content as necessary, which is a plus. However, the excessive use of tags makes painting superfluous. For example, if "I said", you can use the Q tag.

<P> brother wrote not HTML, but lonely.
<P> I said: <br> <q> don't be infatuated with brother. Brother is just a legend. </q>

I think this is enough. If we continue, "I" should be marked with cite, and "html" should be marked with abbr or acronym (as for the difference between abbr and acronym, it is too true ), OK. No need for complexity.

<P> what I wrote was not <abbr Title = "Hyper Text Markup Language"> HTML </abbr>.
<P> <cite> I </CITE> said: <br> <q> don't be infatuated with brother. Brother is just a legend. </q>

Conversion from: standard path (http://www.aa25.cn)

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.