In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail the differences between DIV, Table and XHTML stations. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Website construction, to put it simply, is "what does this person look like" and "how does this person look inside?" One part is the "visual effects" displayed by the appearance, and the other is the "code elements" hidden inside.
Let's start with a simple example of using these three different code styles to achieve the same page effect:
1. The first is to write in table, which requires eight lines of code:
The code is as follows:
Website title
Website content
two。 Then progress to using the DIV,2 line, but because there are two DIV, in order to distinguish, you need to give a different ID:
The code is as follows:
Website title
Website content
3. Use XHTML to write:
The code is as follows:
Website title
Website content
Advantages and disadvantages:
Use a more concise XHTML code style, not just to speed up the opening of the page. After all, now that the network bandwidth is getting larger and larger, there is no obvious difference between opening 10K web code and opening 5K web code. The disadvantage of using XHTML to build a site is also obvious. If it is a website of the same size, it takes 1 hour to do it with TABLE, 2 hours with DIV, and 3 hours with semantic XHTML. Of course, this is just an estimate. According to the difference of the page and the proficiency of the technical staff, there will be some differences in time.
Then why do we spend more time building websites?
Like choosing a wife, we should not only focus on whether this person is beautiful in appearance, but more importantly, we should care about her "internal configuration". Otherwise, we will marry home, go to the hospital every few days, and have a quarrel with you. I'm sure we won't be too happy.
Similarly, to make a website, you can't just look at the design style. What is more important is how the core code is and how the quality is. The website we made is not appreciated by ourselves at home, but more importantly to promote this website and bring network influence to our own enterprises. Let users search for a keyword to find your site, not someone else's.
So how to get search engines to find their own website?
The easiest way is to write code that search engines can understand, that is, machine language.
Search engines do not know what the effect of the page is like, after all, it is a machine, at least not like people, sitting in front of the display, clearly see the appearance, clearly know the difference between primary and secondary. It can only learn about your website and include your website through the machine language, that is, the code you write.
When you use a semantic XHTML, tell it which is the more important title (H1/H2/H3/H4/H5/H6), which is the list (UL/OL/DL), and which is the paragraph (P). It will think that you are a good person, write down the language it can understand, and it will raise your ranking to the top.
And the entire site is a table layout, not to mention the primary and secondary points, search engines will be very difficult to understand. The layout of DIV is even more ridiculous. the whole site is written with id= "title", some with pinyin id= "biaoti", and even with id= "tit01", which has a strange code style. do developers expect computers today to be able to read human languages? even in both Chinese and English?
The relationship among the three
In fact, the relationship between the three should be mentioned at the beginning, for fear that there are too many conceptual things that scare off ordinary readers, and finally briefly introduce them. In fact, table, div are an element of xhtml, table has its own role, it is used to do tables, when the site needs table elements, it is an indispensable part. Div is one of the most commonly used elements. We should give them different missions according to their semantics in machine language, instead of simply taking it and putting it in a place to start using it. In fact, any element can make a website, or even use only p tags to make websites, and only ul tags to do websites, but the things that come out that way, look the same, and actually cause dyslexia for robots. Slow parsing is a small matter, in case it is considered by the search engine to be unfriendly and shielded, it will be troublesome. After all, it's no fun to play the website alone.
This is the end of the article on "what are the differences between DIV, Table and XHTML". I hope the above content can be of some help to you so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.