首页  >  文章  >  web前端  >  HTML 文本属性

HTML 文本属性

WBOY
WBOY原创
2024-09-04 16:18:36821浏览

Html 具有一些功能,可以更方便地显示网页,并且 html 文档包含所有 html 标签元素的嵌套格式等结构。正如我们已经看到的,每个标签元素都包含左尖括号和右尖括号(<>,)。每个 html 元素的扩展名都由成对的标签(如开始标签和结束标签)来指示。 html 文本。 html中有n个标签,用于在用户视角中显示定制级别的网页。一些标签如Example

段落标签是在html文档下定义的,涉及网页中显示的文本内容。

语法:

html为html中的短信属性提供了很多标签;它还有一些元素类型的修饰符。

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

以上代码是html网页中文本属性的基本语法。我们还使用一些其他文本属性,例如“ 等”。这些是我们在网页中使用的 html 中的基本文本属性。我们还根据用户需求使用其他一些用户定义或定制的文本属性。

HTML 文本属性的重要性

一般来说,html属性是Web文档中的特殊单词,因为它们会执行诸如之类的操作。打开和关闭 html 属性;它将根据网页中的属性表现来控制元素的行为。文本还属性 html 元素类型的修饰符,在每个修饰符上,它将在每个 html 元素类型的默认功能上注明,或者它将为某些元素的类型提供无法正确或正确地执行某些功能的功能。网页。

在 html 文档中,属性被添加到使用 html 开始标记中,并且某些基本属性类型(如“必需属性”)将被特定元素类型所需要,以便特定元素类型功能正常工作,而另一个属性称为“可选属性”,它将用于修改 html 元素类型的默认功能。第三种类型,如“标准属性”,它支持许多 html 类型,最后“事件属性”用于使 html 元素类型指定在特定情况下运行的脚本。

某些 html 属性类型的功能将与修改后的 html 元素类型不同。 html 属性将调用具有值对的名称。每个元素都用“=”符号分隔,并且在 html 元素名称和值可以用单引号或双引号括起来之后,也将与 html 元素的开始标记一起写入。此外,一些包含某些字符的值将被保留;也就是说,它们不会在 html 中被引用。尽管如此,它仍然不支持 XHTML,因此一些属性值将不加引号;从 html 文档来看它可能被认为是不安全的。

大部分html元素都会采用html中的一些常用属性; id 属性(如 id 属性)它将提供全球格式的文档,而且它就像 html 元素的唯一标识符,它将使用 css 选择器样式来使用浏览器提供表示属性,以将注意力集中在特定的内容上html 元素或任何与其他内容的脚本相结合的内容都应该更改为演示场景。在html的动态网页中,我们将使用get和post等URL方法来附加网页的URL;它将直接针对文档中的特定 html 元素,并且通常也是网页的子部分,其 id 属性显示为 http://www.examples.com/html#attributes。

任何其他属性(如“class”)提供分类的 html 元素,或者看起来像类似的元素。它对于用于演示目的的 html 文档的语义目的非常有用。而且,类用于微格式类型,html文档类类型看起来像“符号”类型;它表明所有具有该类值的 html 元素都与基于 Web 的文档的主要 html 文本是从属协调的。此类类型的 html 元素必须与网页上页眉和页脚注释的呈现方式聚集并组合在一起,而不是出现在 html 文档源中出现的文本位置。

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 文本属性" ></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 文本属性" ></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 文本属性" ></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>以上是HTML 文本属性的详细内容。更多信息请关注PHP中文网其他相关文章!</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>声明:</span><div>本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn</div></div></div><div class="nphpSytBox"><span>上一篇:<a class="dBlack" title="HTML Style Attribute" href="http://m.php.cn/zh/faq/1796600055.html">HTML Style Attribute</a></span><span>下一篇:<a class="dBlack" title="HTML Block Elements" href="http://m.php.cn/zh/faq/1796600057.html">HTML Block Elements</a></span></div><div class="nphpSytBox2"><div class="nphpZbktTitle"><h2>相关文章</h2><em><a href="http://m.php.cn/zh/article.html" class="bBlack"><i>查看更多</i><b></b></a></em><div class="clear"></div></div><ul class="nphpXgwzList"><li><b></b><a href="http://m.php.cn/zh/faq/348757.html" title="Html小知识总结" class="aBlack">Html小知识总结</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/zh/faq/348804.html" title="如何快速学习HTML" class="aBlack">如何快速学习HTML</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/zh/faq/348873.html" title="html xhtml xml的区别" class="aBlack">html xhtml xml的区别</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/zh/faq/348884.html" title="src与href属性的区别" class="aBlack">src与href属性的区别</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/zh/faq/348902.html" title="关于HTML5和CSS替换使用" class="aBlack">关于HTML5和CSS替换使用</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/zh/"><b class="icon1"></b><p>首页</p></a></li><li><a href="http://m.php.cn/zh/course.html"><b class="icon2"></b><p>课程</p></a></li><li><a href="http://m.php.cn/zh/wenda.html"><b class="icon4"></b><p>问答</p></a></li><li><a href="http://m.php.cn/zh/login"><b class="icon5"></b><p>我的</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/zh/"></a><div class="clear"></div></div><ul class="nphpYouList"><li><a href="http://m.php.cn/zh/"><b class="icon1"></b><span>首页</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh/course.html"><b class="icon2"></b><span>课程</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh/article.html"><b class="icon3"></b><span>文章</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh/wenda.html"><b class="icon4"></b><span>问答</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh/dic.html"><b class="icon6"></b><span>词典</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh/course/type/99.html"><b class="icon7"></b><span>手册</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh/xiazai/"><b class="icon8"></b><span>下载</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh/faq/zt" title="专题"><b class="icon12"></b><span>专题</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/zh/"></a></div><div class="nphpNavIn1"><div class="swiper-container nphpNavSwiper1"><div class="swiper-wrapper"><div class="swiper-slide"><a href="http://m.php.cn/zh/" >首页</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh/article.html" class="hover">文章</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh/wenda.html" >问答</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh/course.html" >课程</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh/faq/zt" >专题</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh/xiazai" >下载</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh/game" >手游</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh/dic.html" >词典</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:setlang('en');" class="language course-right-orders chooselan " 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>