Table Build Station, XHTML build station and Div build station different

Source: Internet
Author: User

Recently, a customer asked the "Table build station, Div build station and the distinction of XHTML build Station", in fact, this is also the domestic web site construction gradually towards the sign of maturity. Website construction, simply speaking, is "how this person looks like" and "how is this person's heart". Part of it is the "visual effect" that the appearance shows, and the other part is the "code element" hidden inside.

Let's start with a simple example of using these 3 different code styles to achieve the same page effect:

1. The first is to write with a table, you need 8 lines of code:


<table>

<tr>

<th> website Title </th>

</tr>

<tr>

<td> website Content </td>

</tr>

</table>


2. Then progress to use div,2 line on it, but because there are two div, in order to differentiate, need to give different IDs:


<div id= "title" > website title </div>

<div id= "Content" > website contents </div>


3. To write in XHTML:


<div> website Content </div>


Disadvantages

With a more concise XHTML code style, not just to improve the page opening speed. After all, now the network bandwidth is getting bigger and larger, open the 10K Web page code and open the 5K page code difference is not obvious. And the drawbacks of the XHTML site are obvious, if it is a site of the same size, with a table to do, 1 hours on it, with a div to 2 hours, with the semantic XHTML will take 3 hours, of course, this is only an estimate, according to the different page and technical proficiency, There will be a certain discrepancy in time.


So why do we spend more time on websites?

Like choosing a wife, we should not only value the appearance of this person is beautiful, and more important is to care about her "internal configuration" how, or marry home, Zooey Run hospital, nothing to quarrel with you, the mood will not be too pleasant.
The same, do the website, can not only see how the design style. The most important thing is how the core code, how quality. We make out of the site is not at home to appreciate, more important is to promote this site, to their own enterprises to bring network influence. Let users search for a keyword to find your site, not to find someone else's site.


So how do you get a search engine to find your site?

The easiest way is to write the code that the search engine can read, which is the machine language.
Search engines do not know what the effect of the page will look like, it is a machine, at least now not with people, sitting in front of the monitor, very clearly see the appearance, very clearly know the primary and secondary points. It can only through the machine language-that is, you write the code to understand your site, included your site.
When you use semantically compliant XHTML, tell it which is the more important title (H1/H2/H3/H4/H5/H6), which is the list (UL/OL/DL), which is the paragraph (P) ... It will think you are a good person, write down the language it can read, it will put your ranking forward.
And the entire site is table layout, not primary and secondary, search engine understanding will also be very laborious. Div layout is even more ridiculous, the entire site is written under the id= "title", and even write the pinyin id= "Biaoti", but also with the id= "Tit01″, strange Code style, the developers in the hope that the current computer can read human language?" Even Chinese and English from the creation of the text all understand?


The relationship between three people

In fact, the opening should mention the relationship between the three, afraid of the concept of too many things, scare away the general reader, the last brief introduction. In fact, table, Div is an element of XHTML, table has its own role, it is used to make tables, when the site needs a TABLE element, it is an integral part. Div is one of the most common elements. We should give them different missions according to their semantics in the machine language, instead of simply put it in a place to start using, in fact, which element can do a website, can even only use the P tag to do the site, only with the UL tag to do the site, but the things that do come out, look the same effect, Can actually cause the robot to read the obstacle. Slow resolution is trivial, in case the search engine is considered unfriendly factors, to shield, the trouble. After all, it's no fun to play on a website.



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.