首頁  >  文章  >  web前端  >  HTML 文字屬性

HTML 文字屬性

WBOY
WBOY原創
2024-09-04 16:18:36823瀏覽

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 樣式屬性" href="http://m.php.cn/zh-tw/faq/1796600055.html">HTML 樣式屬性</a></span><span>下一篇:<a class="dBlack" title="HTML 樣式屬性" href="http://m.php.cn/zh-tw/faq/1796600057.html">HTML 樣式屬性</a></span></div><div class="nphpSytBox2"><div class="nphpZbktTitle"><h2>相關文章</h2><em><a href="http://m.php.cn/zh-tw/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-tw/faq/348757.html" title="Html小知識總結" class="aBlack">Html小知識總結</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/zh-tw/faq/348804.html" title="如何快速學習HTML" class="aBlack">如何快速學習HTML</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/zh-tw/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-tw/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-tw/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-tw/"><b class="icon1"></b><p>首頁</p></a></li><li><a href="http://m.php.cn/zh-tw/course.html"><b class="icon2"></b><p>課程</p></a></li><li><a href="http://m.php.cn/zh-tw/wenda.html"><b class="icon4"></b><p>問答</p></a></li><li><a href="http://m.php.cn/zh-tw/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-tw/"></a><div class="clear"></div></div><ul class="nphpYouList"><li><a href="http://m.php.cn/zh-tw/"><b class="icon1"></b><span>首頁</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh-tw/course.html"><b class="icon2"></b><span>課程</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh-tw/article.html"><b class="icon3"></b><span>文章</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh-tw/wenda.html"><b class="icon4"></b><span>問答</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh-tw/dic.html"><b class="icon6"></b><span>詞典</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh-tw/course/type/99.html"><b class="icon7"></b><span>手册</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh-tw/xiazai/"><b class="icon8"></b><span>下載</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/zh-tw/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-tw/"></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-tw/" >首頁</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh-tw/article.html" class="hover">文章</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh-tw/wenda.html" >問答</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh-tw/course.html" >課程</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh-tw/faq/zt" >專題</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh-tw/xiazai" >下載</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh-tw/game" >遊戲</a></div><div class="swiper-slide"><a href="http://m.php.cn/zh-tw/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:;" class="language course-right-orders chooselan chooselanguage" 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>