dom属性和html属性_HTML属性

dom属性和html属性

Attributes are used to provide additional information of a tag such as it’s alignments, color, size of the text and other. The attributes are given with the tag that is between the angular brackets after the tag name. The attributes have a name and a value. The attribute value is given after the name of the attribute with an equals to the symbol. The attributes are specified with the starting tag of the element. The value of the attribute is generally given within the double-quotes. The value could also be specified in single quotations.

属性用于提供标签的其他信息,例如标签的对齐方式,颜色,文本大小等。 在标签名称后的尖括号之间的标签中给出了属性。 属性具有名称和值。 属性值在属性名称后给出,并带有等于符号的符号。 使用元素的开始标记指定属性。 属性的值通常在双引号内给出。 该值也可以用单引号指定。

Example:

例:

    <FONT SIZE="10"> A TEXT </FONT>

In the above example, the FONT is the element tag and the SIZE is the attribute for the tag FONT. The attribute SIZE specifies the property of the font which is visible for the content of the font tag "A TEXT". The size has been assigned a value of "10".

在上面的示例中, FONT是元素标签, SIZE是标签FONT的属性。 属性SIZE指定字体的属性,该属性对于字体标签“ A TEXT”的内容可见。 大小已分配为值“ 10”

一些常用属性 (Some commonly used attributes)

1) The HEIGHT and WIDTH attribute

1)HEIGHT和WIDTH属性

The height and width attribute specifies these properties of the element for which it has been used, and they receive the values in pixels. An example to illustrate the height attribute is as follows:

height和width属性指定已为其使用元素的这些属性,并且它们接收以像素为单位的值。 一个说明height属性的示例如下:

    <img src="yourimage.jpg"  height="42">

The above code would generate an image with a height of 10px despite its actual height.

上面的代码将生成一个尽管实际高度为10px的图像。

An example to illustrate the width attribute is as follows:

举例说明width属性,如下所示:

    <img src="yourimage.jpg"  width="42">

2) The HREF attribute

2)HREF属性

The href attribute, it specifies the tag the URL of a page where the link has to, also the href attribute is also used to specifies the base URL for all the other related URLs for that page.

href属性,它指定链接必须指向的页面URL的标签, href属性也用于指定该页面所有其他相关URL的基本URL。

    <a href="https://www.yourlink.com">Visit me</a>

The href attribute could also be applied to the anchor (a), AREA, BASE and many other tags.

href属性也可以应用于锚点( a ),AREA,BASE和许多其他标签。

3) The SRC attribute

3)SRC属性

The src attribute specifies the location or the URL of the required file which is present at some external source. The file that is specified could be any file such as an image or an audio or any other media file. Below example illustrate the use of src to specify the image address.

src属性指定在某些外部源上存在的所需文件的位置或URL。 指定的文件可以是任何文件,例如图像或音频或任何其他媒体文件。 下面的示例说明了使用src指定图像地址。

    <img src="yourlocationthenimagename.jpg">

Another example of the src attribute is when it used to specify a file for the script element.

src属性的另一个示例是何时用于为脚本元素指定文件。

    <script src="myscripts.js"></script>

4) The STYLE attribute

4)STYLE属性

The style attribute is used to specify the style for HTML, that is the presentation of the content on the webpage. It gives the inline style to the element. The style attribute could be used for most of the elements as it affects the display of that element.

style属性用于指定HTML的样式,即网页上内容的表示形式。 它为元素提供了内联样式。 样式属性可用于大多数元素,因为它会影响该元素的显示。

Example:

例:

    <p style="color:green">This is a paragraph.</p>

5) The ALT attribute

5)ALT属性

The alt attribute is used to specify a piece of alternative information to the element. This alternative information could be for an image if in case the image is not displayed to the user.

alt属性用于为元素指定一条替代信息。 如果未将图像显示给用户,则该替代信息可以用于图像。

Example:

例:

    <img src="yourimage.jpg" alt=" AN IMAGE ">

The other tags where the alt attribute could be used are INPUT and AREA tags.

可以使用alt属性的其他标签是INPUT和AREA标签。

翻译自: https://www.includehelp.com/html/html-attributes.aspx

dom属性和html属性

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/543729.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

科普:UTF-8 GBK UTF8 GB2312 之间的区别和关系

UTF-8&#xff1a;Unicode TransformationFormat-8bit&#xff0c;允许含BOM&#xff0c;但通常不含BOM。是用以解决国际上字符的一种多字节编码&#xff0c;它对英文使用8位&#xff08;即一个字节&#xff09;&#xff0c;中文使用24为&#xff08;三个字节&#xff09;来编码…

vue3实现本地开发使用的px转换成vw,px转换成rem方法整理

前言&#xff1a; 项目中如果想本地开发使用px&#xff0c;但是界面上线以后界面是自适应的效果,可以有多种方式来实现效果。 一、px转成vw 1、安装&#xff0c;安装成功后&#xff0c;node_modules 会新增这两个插件包 npm i postcss-px-to-viewport-8-plugin 2、新增 post…

airplay2协议是什么_什么是AirPlay?

airplay2协议是什么AirPlay (AirPlay) AirPlay is released by Apple in the year 2004. It allows the easy exchange of audios without the use of any wired technique between the two devices. It was previously termed as AirTunes and later got its name changed to …

微信支付开发(5) 订单查询

本文介绍微信支付中订单查询功能的实现。 作者&#xff1a;方倍工作室 地址&#xff1a;http://www.cnblogs.com/txw1958/p/wxpay-order-query.html 一、订单查询 因为某一方技术的原因&#xff0c;可能导致商户在预期时间内都收不到最终支付通知&#xff0c;此时商户可以通过该…

ruby 执行函数_Ruby at()函数

ruby 执行函数Ruby中的at()函数 (at() function in Ruby) If you are working with arrays in Ruby, sometimes you may need to find the element at a particular index. For meeting the purpose, we have got at() function in Ruby which is already defined in Rubys lib…

python饼形图_Python | 饼形图

python饼形图A pie plot or a pie chart is a circular statistical graphic technique, in which a circle is divided into slices with respect to numerical proportion. In a pie chart, the arc length, central angle, and area of each slice, is proportional to the …

Linux巡检

# uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat /proc/cpuinfo # 查看CPU信息 # hostname # 查看计算机名 # lspci -tv # 列出所有PCI设备 # lsusb -tv # 列出所有USB设备 # lsmod # 列出加载的内核模块 # env # 查看环境变量 # fre…

appweb ejs_EJS部分

appweb ejsHi! Welcome. Today, we are going to look at EJS partials. EJS Partials help us avoid repetition of the same code on several web pages. 嗨&#xff01; 欢迎。 今天&#xff0c;我们将看EJS局​​部函数 。 EJS Partials帮助我们避免在多个网页上重复相同的…

Struts2配置

1. 设定server a) window– preferences – myeclipse – servers – tomcat – 6.x b) 选择tomcat homedirectory c) 选择enable d) finish 2. 设定jdk环境 a) window– preferences – java – installed jres b) 如果没有对应的JDK…

ruby继承_Ruby继承

ruby继承Ruby中的继承 (Inheritance in Ruby) Inheritance is a feature of Object Oriented languages in which new classes are derived from existing classes and resulting in the formation of a hierarchy of classes. The derived class is often called as child cla…

Spring与Hibernate整合中,使用OpenSessionInViewFilter后出现sessionFactory未注入问题

近期在知乎看到一句话&#xff0c;保持学习的有一种是你看到了很多其它的牛人&#xff0c;不甘心&#xff0c;真的不甘心。Spring和hibernate整合的时候&#xff0c;jsp页面做展现&#xff0c;发现展现属性出现&#xff1a; org.apache.jasper.JasperException: could not init…

sql判断数据库类型数据_SQL数据类型

sql判断数据库类型数据SQL | 资料类型 (SQL | Data Types) Just like other programming languages, facilities of defining data of various types are available in SQL also. SQL supports the following data types for the specification of various data-items or field…

同事反馈环:如何实现持续改进的文化

“魔镜魔镜告诉我&#xff0c;谁才是最美丽的人&#xff1f;”&#xff0c;邪恶的皇后如此问道。似乎在精益和敏捷企业中也会有很多与《白雪公主》中类似的问题&#xff0c;如果我们没有一面可以看到我们正在做什么的镜子&#xff0c;我们就很难搞清楚我们有多么美丽&#xff0…

Scala懒惰瓦尔

Scala | 懒惰的瓦尔 (Scala | lazy val) Scala programming language allows the user to initialize a variable as a lazy val. A lazy variable is used when we need to save memory overheads while object creation. Using the lazy keyword, you can halt the initializ…

经典功率谱估计及Matlab仿真

原文出自&#xff1a;http://www.cnblogs.com/jacklu/p/5140913.html 功率谱估计在分析平稳各态遍历随机信号频率成分领域被广泛使用&#xff0c;并且已被成功应用到雷达信号处理、故障诊断等实际工程中。本文给出了经典功率谱估计的几类方法&#xff0c;并通过Matlab的实验仿真…

ruby 三目运算符_Ruby运算符

ruby 三目运算符Ruby运算符 (Ruby operators) Operators are the symbols which assist compiler or interpreter to carry out certain mathematical, logical and relational tasks and produce the results. Operators are method calls with parameters. 运算符是帮助编译器…

极验验证码流程-3.图片加密处理 图片移位

终于把图片加密给搞定了&#xff0c;原理是他把图分成了52个部分&#xff0c;然后通过移动来形成新的图片 主要的位置关系看代码 顺便吐槽下ruby,小众语言就是这么不方便&#xff0c;很多库都没有&#xff0c;百度了半天 最后换成了java来写 图片保存到本地的就不详细说了 主要…

什么是Brouter?

代理&#xff1a;网络设备 (Brouter: A network device) Brouter is a network device, which operates as a combination of both bridge and router. In this single device, a user will get a function of both bridge and router, as it can send out data to create a co…

11gR2 RAC时间同异常导致节点down掉问题处理

实验环境下11204的RAC环境&#xff0c;出现了一个节点DOWN掉的问题。检查日志信息后&#xff0c;在otcssd日志信息发现如下信息&#xff1a;2016-01-17 23:15:20.564: [ CTSS][1175029504]ctsscomm_recv_cb2: Receive incoming message event. Msgtype [3].2016-01-17 23:15…

html-iframe_HTML iframe

html-iframeiframe (Iframes) In HTML, iframes are used to display a webpage inside another webpage. 在HTML中&#xff0c; iframe用于在另一个网页内显示一个网页。 Syntax: 句法&#xff1a; <iframe src"URL"></iframe>The <iframe> tag…