Home  >  Article  >  Web Front-end  >  HTML Text Attributes

HTML Text Attributes

WBOY
WBOYOriginal
2024-09-04 16:18:36823browse

Html has some features for showing web pages more with user-friendly and also the html documents containing a structure like the nested format for all the html tag elements. As we have seen already, each and every tag element containing opening and closing angle brackets(<>,).The Extension of every html element is indicated with the pairs of tags like start and end tags in the html text. There are n number of tags in html for displaying the web pages for customized levels in user perspectives. Some tags like Example

paragraph tag is defined under the html document regarding text content shows in web pages.

Syntax:

The html provides many tags for texting attributes in html; it also has some modifiers for the element types.

<html>
<head>
</head>
<body>
<strong> ---some text--</strong>
</body>
</html>

The above code is the basic syntax for the text attributes in html web pages. We also use some other text attributes like “,,,,,, etc.” these are the basic text attributes in html which we are using in the web pages. We also use some other userdefined or customized text attributes based on user requirements.

Importance of HTML Text Attributes

Generally, the html attributes are the special kind of words in the web documents because they will perform the operations like <> opening and closing in html attributes; it will control the behavior of the elements based on the attribute performance in the web pages. The text also attributes modifiers of the html element types upon either modifier it will be noted on the default functionality of the every html element types, or it will provide the functionality to the certain elements’ types unable to certain functions correctly or properly to the html web pages.

In html document attribute is added to the using html start tag and also some of the several basic attributes types like “required attribute” it will be needed by the particular element type for the particular elements type functionality be working properly, and another attribute called “optional attributes” it will be used to modify the default functionality of the html element type the third type like “standard attributes” it supported many html types and finally the “event attributes” is used to cause the html element types to specify the scripts to be run with the under specific circumstances.

Some of the html attributes types of functionality will differ from the modified html element types. The html attributes will call the name with value pairs. Each will be separated with the “=” symbol, and also same will be written with the start tag of the html element after the html element name and value may be enclosed with the single or double-quotes. Also, some of the values that contain certain characters will be left; that is, they will be unquoted from the html. Still, it does not support XHTML, leaving some attribute values that will be unquoted; it may be considered unsafe from the html document.

Most of the html elements will take some common attributes in html; the id attributes like id attribute it will provide the documents for the worldwide format, and also it’s like unique identifiers of the html element it will take the usage of the css selector styles for providing the presentational properties using browsers to focus the attention on the specific html element or anything combined with the script for other contents it should be altered one it is the presentation scenario. In a dynamic web page for the html, we will use the URL methods like get and post, etc. for appending the URL for a web page; it will directly target the specific html elements within the document and also typically a sub-section for the web page the id attributes shown like http://www.examples.com/html#attributes.

Any other attribute like “class” provides the classified html elements, or it looks like similar elements. It can be very much useful for semantic purposes for the html documents for presentation purposes. Moreover, classes are used in microformats types, and html document class type looks like “notation” types; it indicates that all the html elements with this class values are sub co-ordinate with the main html texts for the web-based documents. Such type of html elements must be gathered and combined together with the presentation for header and footer notes on the web pages instead of it appears in the text places where they will occur in the source of the html documents.

Moreover, CSS styles will be the presentation for the web documents user, or the Author will use the css style attributes for both non-attributable codes, which also looks with presentational properties of the html elements. The css style attributes will call the html based documents with the help of the class and id attributes for selecting the html elements with the style sheets for the web pages. also another sub-text based attributes in the html. In most of web browsers, this attribute will be called as the tooltip for the web pages.</p> <h3>Examples of HTML Text Attributes</h3> <p>Following are the examples:</p> <h4>Example #1</h4> <p><strong>Code:</strong></p> <pre class="brush:php;toolbar:false"><html> <body> <h2>Samples</h2> <p>Welcome To My Domain</p> <a href="https://www.gmail.com">Please login</a> </body> </html></pre> <p><strong>Output:</strong></p> <p><img src="https://img.php.cn/upload/article/000/000/000/172543792231609.png" alt="HTML Text Attributes" ></p> <h4>Example #2</h4> <p><strong>Code:</strong></p> <pre class="brush:php;toolbar:false"><html> <head> <style> .sample { text-transform: uppercase; } .sample1 { text-transform: lowercase; } .sample2 { text-transform: capitalize; } </style> </head> <body> <p class="sample">Welcome to My Domain.</p> <p class="sample1">Welcome to My Domain.</p> <p class="sample2">Welcome to My Domain.</p> </body> </html></pre> <p><strong>Output:</strong></p> <p><img src="https://img.php.cn/upload/article/000/000/000/172543792374995.png" alt="HTML Text Attributes" ></p> <h4>Example #3</h4> <p><strong>Code:</strong></p> <pre class="brush:php;toolbar:false"><html> <head> <style> #sample{ font-size: 33px; font-weight: bold; font-family: Arial; color: green; transition:0.7s; } </style> </head> <body> <p id="sample">Welcome To my Domain</p> <script type="text/javascript"> var b = document.getElementById('sample'); setInterval(function() { b.style.opacity = (b.style.opacity == 0 ? 1 : 0); }, 1000); </script> </body> </html></pre> <p><strong>Output:</strong></p> <p><img src="https://img.php.cn/upload/article/000/000/000/172543792638569.png" alt="HTML Text Attributes" ></p> <h3>Conclusion</h3> <p>We have seen some HTML tags types like text elements; for the web pages, the text tags will be used for basic html documents. Some of the basic tags <h1> to <h10>,<p> etc this type of tags will be used for every html web-based documents. Some tags will be supported for browsers compatibility, and some tags will not be compatible.</p><p>The above is the detailed content of HTML Text Attributes. For more information, please follow other related articles on the PHP Chinese website!</p></div><div class="nphpQianMsg"><a href="javascript:void(0);">css</a> <a href="javascript:void(0);">html</a> <a href="javascript:void(0);">xhtml</a> <a href="javascript:void(0);">for</a> <a href="javascript:void(0);">format</a> <a href="javascript:void(0);">double</a> <a href="javascript:void(0);">using</a> <a href="javascript:void(0);">class</a> <a href="javascript:void(0);">finally</a> <a href="javascript:void(0);">Attribute</a> <a href="javascript:void(0);">Event</a> <a href="javascript:void(0);">number</a> <a href="javascript:void(0);">symbol</a> <a href="javascript:void(0);">default</a> <a href="javascript:void(0);">this</a> <a href="javascript:void(0);">kind</a> <a href="javascript:void(0);">http</a><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="HTML Style Attribute" href="http://m.php.cn/faq/1796600055.html">HTML Style Attribute</a></span><span>Next article:<a class="dBlack" title="HTML Style Attribute" href="http://m.php.cn/faq/1796600057.html">HTML Style Attribute</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>