HTML
HTML、CSS和Javascript的区别
HTML:noun,是内容
CSS:adj,加上效果
Javascript:verb,让字动
入门
HTML kind of like the nouns of a Web page, it is the structure of the content.
It’s the what is on the page.
This is a button.
This is a form.
This is a link.
But it is not the style that counts.It’s not the behavior that would be JavaScript.
HTML element
通过html tags来创造element:opening tag + closing tag
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-5OpD06Ge-1621565875708)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20210520113739141.png)]
wiki
HTML、CSS和JavaScript的百科全书:
HTML所用的element:
HTML elements reference - HTML: HyperText Markup Language | MDN (mozilla.org)
ELement 对象
自然段
<p>Chicken</p>
heading
一页中最好只有一个h1:
<h1>Chicken</h1>
用lorem生成随机文本:
<h2>Terminology</h2>
<p>Lorem ipsum dolor</p>
样本文件(Boilerplate)
<!DOCTYPE html>
告诉浏览器,这是html 5- HTML 元素表示HTML文档的根(顶级元素),因此也称为根元素。所有其他元素必须是该元素的后代
- 一个头后接一个
- The HTML
<head>
element contains machine-readable information (metadata) about the document, like its title, scripts, and style sheets. - title 是百度中的结果标题,是显示在标签卡上的字,不会显示在页面上
<body>
包含所有内容- VScode中用!打开
list element
- ordered list:ol
<ol>
<li>Silkie</li>
<li>Polish</li>
<li>TEE </li>
</ol>
-
unordered list:ul
Zero or more
<li>
,<script>
and<template>
elements.
<ul>
<li>Silkie</li>
<li>Polish</li>
<li>TEE </li>
</ul>
- 也可也嵌套
<ul>
<li>Silkie</li>
<ol>
<li>Silkie</li>
<li>Polish</li>
<li>TEE </li>
</ol>
<li>Polish</li>
<li>TEE </li>
</ul>
Anchor Tags
用来加入超链接,a后的属性href填写指向的连接。
为什么要加https?
不加浏览器默认文件协议,从而通过连接去本地的文件,所以要加https
<p>You can reach Michael at:</p>
<ul>
<li><a href="https://example.com">Website</a></li>
<li><a href="mailto:m.bluth@example.com">Email</a></li>
<li><a href="tel:+123456789">Phone</a></li>
</ul>
图片
alt:方便视障人士听
src:可以加入本地资源
<img class="fit-picture"
src="/media/cc0-images/grapefruit-slice-332-332.jpg"
alt="Grapefruit slice atop a pile of other slices">
注释
<!--注释内容--> ctrl+/