在HTML中,VAR元素类型有什么用途?

In this article we will discuss about Var element in HTML. We will learn about its properties and its importance in HTML. And why we specifically use it in mathematical expression. But before we learn about VAR we must know about HTML element.

HTML element is a section of an HTML document that tells the browser how to represent the information of that section. It contains necessary information like instructions, idea of the webpage and main content.

HTML element mainly consists of three parts −

  • Opening tag − It marks the beginning of the HTML element and tells the browser about the starting of the content.

  • Closing tag − It marks the closing of the HTML element and tells the browser where it has to stop looking for content.

  • Content − This part contains the main information of the webpage and it lies between the opening and closing tag. Only this part of the HTML element will be visible to the user on the webpage.

VAR Element

在HTML中,var代表变量。b7f90f73cad438258bf67e62f79b2113标签用于标记编程或数学表达式中的变量。在编写方程时,通常用于以不同方式显示方程的变量。b7f90f73cad438258bf67e62f79b2113标签是一个容器标签,即它有开放和结束标签。

默认情况下,b7f90f73cad438258bf67e62f79b2113元素内的内容在浏览器中呈现为斜体文本,但我们可以通过在b7f90f73cad438258bf67e62f79b2113元素上应用字体CSS属性来修改它。

Now we will be looking at some examples of using a var tag in different situations.

Example

让我们看一个例子 –

<!DOCTYPE html>
<html lang="en">
<head>
   <title>VAR Element</title>
</head>
<body>
   <h1>This is an example of VAR element in HTML</h1>
   <p> <var>VAR</var> element is used to mark the variable in a mathematical expression or equation. The content written inside the var element renders as <var>italic </var> text on the browser.</p>
</body>
</html>

Example

以下是一个使用 var 元素打印二次方程的示例。

<!DOCTYPE html>
<html lang="en">
<head>
   <title>VAR Element</title>
</head>
<body>
   <h1>This is an example of VAR element in HTML</h1>
   <p>The standard form of a quadratic equation is   <var>a</var><var>x</var><sup>2</sup>+<var>b</var><var>x</var>+<var>c</var>=0 and the basic form of this equation is <var>x</var><sup>2</sup>+<var>b</var><var>x</var>+<var>c</var>=0</p>
</body>
</html>

Example

<!DOCTYPE html>
<html lang="en">
<head>
   <title>VAR Element</title>
</head>
<body>
   <h1>This is an example of VAR element in HTML</h1>
   <p>The area of a triangle is: 1/2 x <var>b</var> x <var>h</var>, where <var>b</var> is the base, and <var>h</var> is the vertical height.  And the area of a rectange is: <var>l</var>x<var>b</var>,where <var>l</var>is the length of the rectangle, and <var>b</var> is the breadth of the rectangle.</p>
</body>
</html>

为什么我们应该在HTML中使用VAR元素

The content that we write between two tags renders differently on the browser, that is somewhat similar to an italicized text. Then the question comes in mind is that why don’t we use an italic tag instead of var tag when all we get is just italic text. The answer to that question is SEO.

SEO − 搜索引擎优化被称为SEO。它有助于改善网站,使其在客户搜索该产品或类似产品时在众多搜索结果中排名更高。这将是有利的,因为更多网站的实际目标受众将能够查看它。此外,它还有助于保持流量和有机流量。

Every tag in HTML is accompanied by some sort of meaning. For instance, the h1 tag identifies a primary heading and all of the text within it is associated with that subject. Below is a list of other HTML tags with unique meanings −

  • Aside − 将其中的内容与主要内容隔离开来。

  • Article tag − isolates the content from the rest of the article.

  • 部分 – 将网站上的内容与其他内容隔离开来。

  • Header − 隔离页面的顶部。

  • Footer − isolates the bottom of the page.

  • Nav − basically contains the navigation menu for the page.

类似于var标签和强调格式具有完全不同的语义含义。<var>标签告知浏览器和搜索引擎,其中包含的信息是某种数学表达式或其结果。然而,斜体语言只是表示作者想要引起对该词的注意。因此,使用<var>标签的文章在搜索引擎优化方面表现更好,排名也比使用斜体或em标签来定义表达式的文章更高。

Example

这是使用VAR元素标记变量的示例 –

<!DOCTYPE html>
<html lang="en">
<head>
   <title>Example</title>
</head>
<body>
   <h1>Marking variable using VAR element</h1>
   <p><var>VAR</var> element is used to mark the variable in a mathematical expression or equation.</p>
</body>
</html>

Example

这是使用斜体元素标记变量的示例 –

<!DOCTYPE html>
<html lang="en">
<head>
   <title>Example</title>
</head>
<body>
   <h1>Marking variable using Italic element</h1>
   <p><i>VAR</i> element is used to mark the variable in a mathematical expression or equation.</p>
</body>
</html>

正如我们所看到的,VAR和Italic元素生成相同的输出,但是使用VAR标签的网页将在搜索结果中排名靠前,即使它们的内容是相同的。

结论

In this article we discussed about VAR element in HTML. We learnt about different ways of using VAR element and at last we discuss how we can use it for better search engine optimization.

以上就是在HTML中,VAR元素类型有什么用途?的详细内容,更多请关注双恒网络其它相关文章!

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
8. 精力有限,不少源码未能详细测试(解密),不能分辨部分源码是病毒还是误报,所以没有进行任何修改,大家使用前请进行甄别
9.本站默认解压密码为:www.sudo1.com
本站提供的一切软件、教程和内容信息仅限用于学习和研究目的。
不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。
本站信息来自网络收集整理,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。
如果您喜欢该程序和内容,请支持正版,购买注册,得到更好的正版服务。
我们非常重视版权问题,如有侵权请邮件与我们联系处理。敬请谅解!

云资源网 » 在HTML中,VAR元素类型有什么用途?

常见问题FAQ

免费下载或者VIP会员专享资源能否直接商用?
本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
提示下载完但解压或打开不了?
最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用百度网盘软件或迅雷下载。 若排除这种情况,可在对应资源底部留言,或 联络我们.。
你们有qq群吗怎么加入?
当然有的,如果你是帝国cms、易优cms、和pbootcms系统的爱好者你可以加入我们的QQ千人交流群https://www.sudo1.com/page-qun.html。
  • 会员数(个)
  • 12334资源数(个)
  •        
  • 资源(G)
  •        
  • 今日下载
  • 1406稳定运行(天)

提供最优质的资源集合

立即查看 了解详情