首页 > 其他分享 >HTML 11 - Phrase Tags

HTML 11 - Phrase Tags

时间:2024-05-18 15:19:48浏览次数:12  
标签:11 ... text element HTML Text Phrase Example

 

The phrase tags have been designed for specific purposes, though they are displayed in a similar way as other basic tags like <b>, <i>, <pre>, and <tt>, as you have seen in the previous chapter. This chapter will take you through all the important phrase tags, so let's start seeing them one by one.

Emphasized Text

Content that is enclosed within <em>...</em> element is displayed as emphasized text. The <em> element typically renders text in italics, indicating emphasis.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Emphasized Text Example</title>
</head>
<body>
   <p>The following word uses a <em>emphasized</em> typeface. </p>
</body>
</html>

 

Marked Text

Anything that is enclosed with-in <mark>...</mark> element, is displayed as marked with yellow ink.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Marked Text Example</title>
</head>
<body>
   <p>The following word has been <mark>marked</mark> with yellow </p>
</body>
</html>

 

Strong Text

Content that is enclosed within <strong>...</strong> element is displayed as important text. The <strong> element displays text in a bold font, indicating strong importance.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Strong Text Example</title>
</head>
<body>
   <p>The following word uses a <strong>strong</strong> typeface. </p>
</body>
</html>

 

Text Abbreviation

You can abbreviate a text by putting it inside opening <abbr> and closing </abbr> tags. If present, the title attribute must contain this full description and nothing else.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Text Abbreviation</title>
</head>
<body>
   <p>My best friend's name is <abbr title="Abhishek">Abhy</abbr>. </p>
</body>
</html>

 

Text Direction

The <bdo>...</bdo> element stands for Bi-Directional Override and it is used to override the current text direction.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Text Direction Example</title>
</head>
<body>
   <p>This text will go left to right.</p>
   <p>
      <bdo dir="rtl">This text will go right to left.</bdo>
   </p>
</body>
</html>

 

Special Terms

The <dfn>...</dfn> element (or HTML Definition Element) allows you to specify that you are introducing a special term. Its usage is similar to italic words in the midst of a paragraph.

Typically, you would use the <dfn> element the first time you introduce a key term. Most recent browsers render the content of a <dfn> element in an italic font.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Special Terms Example</title>
</head>
<body>
   <p>The following word is a <dfn>special</dfn> term. </p>
</body>
</html>

 

 

Quoting Text

When you want to quote a passage from another source, you should put it in between <blockquote>...</blockquote> tags.

Text inside a <blockquote> element is usually indented from the left and right edges of the surrounding text and sometimes uses an italicized font.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Blockquote Example</title>
</head>
<body>
   <p>The following description of XHTML is taken from the W3C Web site:</p>
   <blockquote>XHTML 1.0 is the W3C's first Recommendation for XHTML, following on from earlier work on HTML 4.01, HTML 4.0, HTML 3.2 and HTML 2.0.</blockquote>
</body>
</html>

 

Short Quotations

The <q>...</q> element is used when you want to add a double quote within a sentence. By using <q>...</q>, you ensure that the enclosed text is presented as a direct quotation, enhancing readability and maintaining proper punctuation in your HTML document.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Double Quote Example</title>
</head>
<body>
   <p>Amit is in Spain, <q>I think I am wrong</q>. </p>
</body>
</html>

 

Text Citations

If you are quoting a text, you can indicate the source placing it between an opening <cite>tag and closing </cite> tag

As you would expect in a print publication, the content of the <cite> element is rendered in italicized text by default.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Citations Example</title>
</head>
<body>
   <p>This HTML tutorial is derived from <cite>W3 Standard for HTML</cite>. </p>
</body>
</html>

 

Computer Code

Any programming code to appear on a Web page should be placed inside <code>...</code> tags. Usually the content of the <code> element is presented in a monospaced font, just like the code in most programming books.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Computer Code Example</title>
</head>
<body>
   <p>Regular text. <code>This is code.</code> Regular text. </p>
</body>
</html>

 

Keyboard Text

When you are talking about computers, if you want to tell a reader to enter some text, you can use the <kbd>...</kbd> element to indicate what should be typed in, as in this example.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Keyboard Text Example</title>
</head>
<body>
   <p>Regular text. <kbd>This is inside kbd element</kbd> Regular text. </p>
</body>
</html>

 

Programming Variables

The <var> element is usually used in conjunction with the <pre> and <code> elements to indicate that the content of that element is a variable.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Variable Text Example</title>
</head>
<body>
   <p>
      <code>document.write(" <var>user-name</var>") </code>
   </p>
</body>
</html>

 

Program Output

The <samp>...</samp> element indicates sample output from a program, and script etc. Again, it is mainly used when documenting programming or coding concepts.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Program Output Example</title>
</head>
<body>
   <p>Result produced by the program is <samp>Hello World!</samp>
   </p>
</body>
</html>

 

Address Text

The <address>...</address> element is used to contain any address.

Example

<!DOCTYPE html>
<html>
<head>
   <title>Address Example</title>
</head>
<body>
   <address>388A, Road No 22, Jubilee Hills - Hyderabad</address>
</body>
</html>

 

 

 

标签:11,...,text,element,HTML,Text,Phrase,Example
From: https://www.cnblogs.com/emanlee/p/18190421

相关文章

  • HTML 10 - Comments
    HTMLCommentsareusedtocommentinHTMLcodes,sothedevelopercanunderstandthepurposeofthatcodesectionanditishelpfullfordebuggingalso.Ifwearefacingsomeissuebecouseofanyparticularelementwecahcheckitbycommentingoutthate......
  • 代码随想录算法训练营第第11天 | 20. 有效的括号 、1047. 删除字符串中的所有相邻重
    今天的题主要是关于栈的,比较简单,一次性过20.有效的括号讲完了栈实现队列,队列实现栈,接下来就是栈的经典应用了。大家先自己思考一下有哪些不匹配的场景,在看视频我讲的都有哪些场景,落实到代码其实就容易很多了。题目链接/文章讲解/视频讲解:https://programmercarl.com/0020.......
  • HTML 09 - Quotations
     QuotationsinHTMLallowyoutoincludeandformatquotedtextwithinyourwebcontent.HTMLprovidestagssuchas<blockquote>,<q>,<cite>,<address>,<bdo>and<abbr>tostructureandstylequotes.Thesetagshelp......
  • Codeforces 1113B Sasha and Magnetic Machines 题解
    题目简述有一个长度为$n$的正整数序列。你可以对这个数列进行最多$1$次的如下操作:选择两个数$i$和$j$,其中$1\leqi,j\leqn$并且$i\neqj$,并选择一个可以整除$a_i$的正整数$x$,然后将$a_i$变为$\frac{a_i}{x}$,将$a_j$变为$a_j\cdotx$。问你操作后,该序......
  • Codeforces 1178B WOW Factor
    题目简述给定一个只含$v$和$o$的字符串$s$,求字符串中有多少个$wow$(一个$w$即为连续的两个$v$)。题目分析考虑枚举每一个$o$,设下标为$i$,统计它左边和右边各有多少个$w$,分别设为$a_{i-1}$和$b_{i+1}$,依据乘法原理,将它们乘起来即为答案,累加即可。接下来,考虑怎么处......
  • 「杂题乱刷」AT_abc211_e
    题目链接[ABC211E]RedPolyomino(luogu)[ABC211E]RedPolyomino(at)解题思路从第三个样例可以看出总的方案数一定很少,因此我们可以直接确定第一个被染色的格子后直接向外爆搜,搜到最后可以使用哈希判重,但光凭这样的话\(2\)秒钟肯定跑不过去,因此我们可以在搜索的过程中使用......
  • HTML5中 drag 和 drop api
    被拖放元素--A,目标元素--B。dragstart事件主体是A,在开始拖放A时触发。dragend事件主体是A,在整个拖放操作结束时触发。drag事件主体是A,正在拖放A时触发(整个拖拽,drag事件会在被拖拉的节点上持续触发,相隔几百毫秒)。dragenter事件主体是B,在A进入某元素的时候触发。drago......
  • HTML相关知识(二)- Jinja2
    1.for循环{%foriteminmy_list%}是Jinja2模板引擎中的语法,用于在模板中进行循环操作。这里的`my_list`是一个列表,`item`是列表中的每一个元素。在Flaskweb框架中,我们可以在Python代码中定义一个列表,然后将这个列表传递给模板。在模板中,我们可以使用`{%for%}`......
  • Oracle11g-EXP-00091错误
    环境说明oracle11gwin10问题情况在终端中exp导出数据库时,遇到报错“EXP-00091”,按照网上教程修改NLS_LANG但是没有效果。最终原因在power中设置环境变量NLS_LANG的方法与CMD不一样。备注记录先通过服务端查询编码集select*fromnls_database_parameterstwheret.pa......
  • hdu1176免费馅饼java
    一个数塔问题,以时间为纵坐标、位置为横坐标创建一个二维数组,然后从下往上相加。状态转移方程:9>=j>=1时dp[i][j]+=max(max(dp[i+1][j],dp[i+1][j+1]),dp[i+1][j-1])  j=0时 dp[i][j]+=max(dp[i+1][j],dp[i+1][j+1]) j=10时dp[i][j]+=......