Home  >  Article  >  Web Front-end  >  Return the html tag to its original meaning_html/css_WEB-ITnose

Return the html tag to its original meaning_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:40:07942browse

To be honest, the term "div css" has harmed many people. Maybe the original intention of the person who proposed it is not wrong, but the followers misinterpreted its meaning and thought that the entire page should be It is a combination of div css files. Doing this has no visual impact, because it restores the previously designed page renderings, but if this HTML document is handed over to a machine (such as a spider) for analysis, it may not be able to find the key points at all, and your entire page will be focused on it. For example, it is like a termite nest. The first thing it needs to do is to remove the same things and then filter the content.

The development of search engines has given birth to a profession "seo" in the Internet industry. Because they have to do "keywords", almost all "seo" put their "technical core" on researching keywords. In addition to making the title, keywords, description and entire document full of keywords that may be of interest to search engines. Even the alt attribute of the image and the title attribute of the text container are "keywords". Such seemingly perfect "seo technology" often ignores two important points: 1. The definition of html tags. 2. Streamline the page. The former allows search engines to have an "understanding" of the "meaning" throughout the page, while the latter improves access speed and reduces server load. It’s a pity that “seo” people often don’t understand HTML and load, and people who write code often don’t understand “seo technology”. This may cause a considerable career bottleneck, and the mentality of eager for quick success and quick profit makes these two professions They don’t learn from each other and each does his own thing.

In my development experience, I have encountered html tags that are all divs. It seems that except for the and , the rest are all

(mine My understanding is: the entire html is assembled from 10,000 unrelated contents); I have also encountered that the entire article is structured as
  • (my understanding is: all elements of this page It’s all a list). In fact, these two situations are quite common. Because of the misunderstanding of the true meaning of "div css", perhaps there should be no such term at all, because it is almost impossible to complete a complete page with just div css; the original meaning of this term may be "Presented by html css divided by divs", I believe it would be more reliable to say "html css", but this does not reflect the "popularity" of "flow layout"... It is really troublesome.

    There are more than 50 kinds of html tags, see Chapter 4 for details. Our commonly used html tags (except form tags) mainly include the following:

    div, ul, ol, li, dl, dt,dd,p,span,h1-h6,label,em,strong,img,a,u,b,i,s...

    I think it is necessary to give their definitions and give them later They are divided into groups. The w3c grouping is more scientific than me, but not as easy to understand as me:

    div: division (separate, split, distinguish, allocate, dividing line), tags can divide the document into independent, different parts. As a representative of block-level elements, because there is no fixed format, it is currently the most abused.

    ul:unordered list (unordered list) is combined with the li element to form a group.

    ol:ordered list (ordered list) is combined with the li element to form a group.

    li:list item (list item) must be within the parent ul or ol container. This must be added by myself. w3c just said this:

    contexts in which this element can be used: inside elements. inside elements. inside elements.

    I added a must in front of it to express the seriousness of this problem ^^

    dl:definition list (definition list) is combined into a group with dt (items defined by definition term) and dd (description defined by definition description).

    p:paragraph (paragraph) is used to store a paragraph of the article.

    span: The span (range) tag is used to combine the content of sections in the document. As an inline element, and because it does not have a fixed format, it is currently abused more.

    h1-h6: head (title 1 to title 6), please note that the head here represents its meaning, which is different from the tag, and do not think it has anything to do with . This is just a title that highlights the content of the document. </p> <p>Note that if the search engine finds that there is an h tag in the page, it will consider the content in it to be more important, and the importance will gradually decrease from 1 to 6. </p> <p>label:label (label for form controls), its name is label, but here, the definition given by w3c is that it is used as a description of the form, for example, we like to put it before or after the input label Add it. </p> <p>em: emphasized (emphasis, emphasis), to emphasize the text it contains. The default style is italic. The display effect is similar to the <i> tag, but search engines do not think they are the same, because search engines tend to respect the definition given by w3c and ignore your display effect. </p> <p>strong:strong (emphasis, emphasis), to emphasize the text it contains. The default style is bold. Its emphasis effect is a little stronger than em. Although the <b> tag can also have a bold display effect, search engines do not consider them to be the same for the same reason. </p> <p>img:image (picture, image); </p> <p>a:anchor (anchor) creates the basic chain in a hyperlink. </p> <p>u: underline (text underline), will be eliminated soon. </p> <p>s/strike: strikethrough, draw a line across the text. </p> <p>According to display style: </p> <p>Block-level elements or block elements, (default style is block) tags: </p> <p>div,ul,ol,li,p ,dl,dt,dd, h1-h6...</p> <p>They will occupy one line by default. Unless you change them with styles. </p> <p> Inline elements, (the default style is inline, but I think it is easier to understand called "inline elements") labels are: </p> <p>span, label, em, strong, img, a,u,b,i,s...</p> <p>By default, they will coexist in a row with other elements. When you add some specific styles to them, for example: display:block , they will also dominate a row. But what should be mentioned in advance here is that not all display:blocks must occupy one line. If there is width, and float is used as a pusher to push them forward, they will be squeezed into one line with other elements. </p> <p>According to combination: </p> <p>Fixed groups: </p> <p>ul--li</p> <p>ol--li</p> <p>dl-- dt--dd</p> <p>Scattered individuals: </p> <p>Others...</p> <p>Some explanations are needed: </p> <p>1. Inline elements, they They are not "framed", that is, their size is controlled by their content. Before it becomes a block-level element, it is useless for you to control its width and height. Ways to become a block-level element: 1. display:block (directly occupying the entire row) 2. float will not occupy the entire row, but you can control its width or height. </p> <p>2. Some elements that cannot be included or nested (copied from w3c): </p> <p>a: cannot contain other a tags. </p> <p>must not contain other a element.</p> <p>pre: (preformatted predefined format (text)) cannot contain img, object, big, small, sub, or sup elements </p> <p>must not contain the img, object, big, small, sub, or sup elements.</p> <p>button button, cannot contain input, select, textarea, label, button, form, fieldset, iframe or isindex elements.</p> <p>must not contain the input, select, textarea, label, button, form, fieldset, iframe or isindex elements.</p> <p>label must not contain other label elements</p> <p>must not contain other label elements.</p> <p>form must not contain other form elements.</p> <p> </p> <p class="sycode"></p> <p class="sycode"> </p> <p class="sycode"> </p> <p class="sycode"></p> <p class="sycode"> </p> <p class="sycode"></p> <p class="sycode"></p> <p class="sycode"> </p></div><div class="nphpQianMsg"><div class="clear"></div></div><div class="nphpQianSheng"><span>Statement:</span><div>The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn</div></div></div><div class="nphpSytBox"><span>Previous article:<a class="dBlack" title="Stylus makes it easy to implement CSS prefixes and reset CSS_html/css_WEB-ITnose" href="http://m.php.cn/faq/272938.html">Stylus makes it easy to implement CSS prefixes and reset CSS_html/css_WEB-ITnose</a></span><span>Next article:<a class="dBlack" title="Stylus makes it easy to implement CSS prefixes and reset CSS_html/css_WEB-ITnose" href="http://m.php.cn/faq/272940.html">Stylus makes it easy to implement CSS prefixes and reset CSS_html/css_WEB-ITnose</a></span></div><div class="nphpSytBox2"><div class="nphpZbktTitle"><h2>Related articles</h2><em><a href="http://m.php.cn/article.html" class="bBlack"><i>See more</i><b></b></a></em><div class="clear"></div></div><ul class="nphpXgwzList"><li><b></b><a href="http://m.php.cn/faq/348757.html" title="Summary of Html knowledge" class="aBlack">Summary of Html knowledge</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/348804.html" title="How to learn HTML quickly" class="aBlack">How to learn HTML quickly</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/348873.html" title="The difference between html xhtml xml" class="aBlack">The difference between html xhtml xml</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/348884.html" title="The difference between src and href attributes" class="aBlack">The difference between src and href attributes</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/348902.html" title="About HTML5 and CSS replacement use" class="aBlack">About HTML5 and CSS replacement use</a><div class="clear"></div></li></ul></div></div><div class="nphpFoot"><div class="nphpFootBg"><ul class="nphpFootMenu"><li><a href="http://m.php.cn/"><b class="icon1"></b><p>Home</p></a></li><li><a href="http://m.php.cn/course.html"><b class="icon2"></b><p>Course</p></a></li><li><a href="http://m.php.cn/wenda.html"><b class="icon4"></b><p>Q&A</p></a></li><li><a href="http://m.php.cn/login"><b class="icon5"></b><p>My</p></a></li><div class="clear"></div></ul></div></div><div class="nphpYouBox" style="display: none;"><div class="nphpYouBg"><div class="nphpYouTitle"><span onclick="$('.nphpYouBox').hide()"></span><a href="http://m.php.cn/"></a><div class="clear"></div></div><ul class="nphpYouList"><li><a href="http://m.php.cn/"><b class="icon1"></b><span>Home</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/course.html"><b class="icon2"></b><span>Course</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/article.html"><b class="icon3"></b><span>Article</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/wenda.html"><b class="icon4"></b><span>Q&A</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/dic.html"><b class="icon6"></b><span>Dictionary</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/course/type/99.html"><b class="icon7"></b><span>Manual</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/xiazai/"><b class="icon8"></b><span>Download</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/faq/zt" title="Topic"><b class="icon12"></b><span>Topic</span><div class="clear"></div></a></li><div class="clear"></div></ul></div></div><div class="nphpDing" style="display: none;"><div class="nphpDinglogo"><a href="http://m.php.cn/"></a></div><div class="nphpNavIn1"><div class="swiper-container nphpNavSwiper1"><div class="swiper-wrapper"><div class="swiper-slide"><a href="http://m.php.cn/" >Home</a></div><div class="swiper-slide"><a href="http://m.php.cn/article.html" class="hover">Article</a></div><div class="swiper-slide"><a href="http://m.php.cn/wenda.html" >Q&A</a></div><div class="swiper-slide"><a href="http://m.php.cn/course.html" >Course</a></div><div class="swiper-slide"><a href="http://m.php.cn/faq/zt" >Topic</a></div><div class="swiper-slide"><a href="http://m.php.cn/xiazai" >Download</a></div><div class="swiper-slide"><a href="http://m.php.cn/game" >Game</a></div><div class="swiper-slide"><a href="http://m.php.cn/dic.html" >Dictionary</a></div><div class="clear"></div></div></div><div class="langadivs" ><a href="javascript:;" class="bg4 bglanguage"></a><div class="langadiv" ><a onclick="javascript:setlang('zh-cn');" class="language course-right-orders chooselan " href="javascript:;"><span>简体中文</span><span>(ZH-CN)</span></a><a onclick="javascript:;" class="language course-right-orders chooselan chooselanguage" href="javascript:;"><span>English</span><span>(EN)</span></a><a onclick="javascript:setlang('zh-tw');" class="language course-right-orders chooselan " href="javascript:;"><span>繁体中文</span><span>(ZH-TW)</span></a><a onclick="javascript:setlang('ja');" class="language course-right-orders chooselan " href="javascript:;"><span>日本語</span><span>(JA)</span></a><a onclick="javascript:setlang('ko');" class="language course-right-orders chooselan " href="javascript:;"><span>한국어</span><span>(KO)</span></a><a onclick="javascript:setlang('ms');" class="language course-right-orders chooselan " href="javascript:;"><span>Melayu</span><span>(MS)</span></a><a onclick="javascript:setlang('fr');" class="language course-right-orders chooselan " href="javascript:;"><span>Français</span><span>(FR)</span></a><a onclick="javascript:setlang('de');" class="language course-right-orders chooselan " href="javascript:;"><span>Deutsch</span><span>(DE)</span></a></div></div><script> var swiper = new Swiper('.nphpNavSwiper1', { slidesPerView : 'auto', observer: true,//修改swiper自己或子元素时,自动初始化swiper observeParents: true,//修改swiper的父元素时,自动初始化swiper }); </script></div></div><!--顶部导航 end--><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script></div><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='/static/js/viewer.min.js?1'></script><script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script><script>jQuery.fn.wait = function (func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = this.selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } $("table.syntaxhighlighter").wait(function() { $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>"); }); $(document).on("click", ".cnblogs_code_footer",function(){ $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide(); }); $('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}}); </script></body></html>