HTML笔记

1.网站重定向方法

<head>
<meta http-equiv="Refresh" content="5;url=http://www.w3school.com.cn" />
</head>

2.标签居中属性

<h1 align="center">This is heading 1</h1>

3.body变更颜色属性

<body bgcolor="yellow">
<h2>请看: 改变了颜色的背景。</h2>
</body>

4.创建一条水平线的标签

<hr />

5.注释的添加方法

<!--这是一段注释。注释不会在浏览器中显示。-->

6.间隔一个空行的标签

<br /> 

个新段落的情况下进行换行(新行)

<p>我是<br />换行</p>

7.加删除线的标签

<s>这个是加了删除线的</s> (貌似后面会弃用)

<del>二十</del>   

7-1.加下滑线的标签

<del>二十</del>

8.保存多个空格和换行的标签

<pre>
这是
预格式文本。
它保留了        空格
和换行。
</pre>

9.a标签写法

<a href="mailto:webmaster@example.com">Donald Duck</a>.<br> 

10.倒着输出要输出的字段的方法(输出为 Here is some Hebrew text)

<bdo dir="rtl">
Here is some Hebrew text
</bdo>

11.单选按钮 #加checked属性可默认勾选

female:<input type="radio" name="gender" checked  value="female"> 

看到这里 http://www.w3school.com.cn/html/html_quotation_elements.asp 

12、相对定位

<style type="text/css">

h2.pos_left{position:relative;top:140px;left:120px}

</style>

<h2 class="pos_left">这个标题相对于其正常位置向左移动</h2>

13、绝对定位

{position: absolute;top:40px;left:220px}

14、竖线的实现

<style type="text/css">

div.su

{
0;
height:150px;
border-style: ridge;
border-left:50px;
border-color:black;
position: absolute;
top:40px;
left:620px
}

</style>

<div class="su"></div>

15、空格标签

&nbsp

16、换行标签

<br>

原文地址:https://www.cnblogs.com/kaibindirver/p/10010379.html