美文网首页
标签,属性和元素

标签,属性和元素

作者: 淇漯草 | 来源:发表于2018-08-08 10:55 被阅读0次

标签

<!DOCTYPE html>
<html>
<body>

    This is my first web page
</body>
</html>

<!DOCTYPE html>

The first line on the top, <!DOCTYPE html>, is a document type declaration and it lets the browser know which flavor of HTML you’re using (HTML5, in this case). It’s very important to stick this in - If you don’t, browsers will assume you don’t really know what you’re doing and act in a very peculiar way.

<html> <body>

To get back to the point, <html> is the opening tag that kicks things off and tells the browser that everything between that and the </html> closing tag is an HTML document. The stuff between <body> and </body> is the main content of the document that will appear in the browser window.

不是所有都要结束的,如换行符

Not all tags have closing tags like this (<html></html>) some tags, which do not wrap around content will close themselves. The line-break tag for example, looks like this :
- a line break doesn’t hold any content so the tag merrily sits by its lonely self. We will come across these examples later. All you need to remember is that all tags with content between them should be closed, in the format of opening tag → content → closing tag. It isn’t, strictly speaking, always a requirement, but it’s a convention we’re using in these tutorials because it’s good practice that results in cleaner, easier to understand code.

属性

Tags can also have attributes, which are extra bits of information. Attributes appear inside the opening tag and their values sit inside quotation marks. They look something like <tag attribute="value">Margarine</tag>. We will come across tags with attributes later.

在开始的时候插入
<tag attribute = 'value'>Margarine</tag>

Elements

As another example, whereas “<title>” and “</title>” are tags, “<title>Rumple Stiltskin</title>” is a title element.

标签内部,包括标签的,就叫做元素

相关文章

  • 2018.03.14前端学习第三课笔记

    给元素加样式 <标签 属性名=“属性”> style标签添加样式,如下: 分离内容和样式、元素分类和命名 标签选择...

  • 标签,属性和元素

    标签 The first line on the top,

  • css设计指南第一章

    1 文本元素使用闭合标签 标签格式:<标签>内容 2 引用内容用自闭和标签 <标签名 属性1="" 属性...

  • audio、video和canvas

    一、video和audio元素的属性、方法、事件 1.标签 :视频标签 :音频标签 2.属性: src :...

  • 置换元素和非置换元素

    置换元素 置换元素是指:浏览器根据元素的标签和属性,来决定元素的具体显示内容。 例如:浏览器根据 标签的src属性...

  • HTML的标签简单复习

    HTML元素 指的是一个标签内的所有内容(包括标签)HTML标签属性 标签属性可以为元素添加额外的信息,标签属性在...

  • HTML基本元素

    HTML元素基本格式 <标签名 属性1=值1 属性2=值2......>元素内容 常用标签 标题 ...

  • Part 1-2 HTML元素

    HTML元素和属性 类似于这样成对出现的结构,称之为元素.元素结构 : 开始标签 + 内容 + 结束标签 元素的出...

  • 前端高频面试题-HTML&CSS部分

    行内元素/块级元素 img的title和alt属性 meta标签 DOCTYPE标签 标准模式 兼容模式 scri...

  • 2018-07-18课堂笔记(DOM文档对象模型)

    创建标签属性 把创建的元素插入进去的属性 给元素添加内容 并且该属性可以识别标签 只能添加文本 而且不能添加标签,...

网友评论

      本文标题:标签,属性和元素

      本文链接:https://www.haomeiwen.com/subject/oartbftx.html