饥人谷技术博客web

HTML标签

2018-10-30  本文已影响6人  阿小经

目录


HTML常用标签

<html></html> 创建一个HTML文档
<head></head> 设置文档标题和其它在网页中不显示的信息
<title></title> 设置文档的标题
<body></body> 定义 HTML 文档的主体 // <body bgcolor="yellow"> 拥有关于背景颜色的附加信息。

<h1></h1> 最大的标题 // <h1 align="center"> 拥有关于对齐方式的附加信息
<pre></pre> 预先格式化文本
<u></u> 下划线
<b></b> 黑体字
<i></i> 斜体字
<cite></cite> 引用,通常是斜体
<em></em> 强调文本(通常是斜体加黑体)
<strong></strong> 加重文本(通常是斜体加黑体)

<p></p> 创建一个段落
<p align=""> 将段落按左、中、右对齐  
<dl></dl> 定义列表
<dt> 放在每个定义术语词前
<dd> 放在每个定义之前
<ol></ol> 创建一个标有数字的列表
<ul></ul> 创建一个标有圆点的列表
<li> 放在每个列表项之前,若在<ol></ol>之间则每个列表项加上一个数字,
若在<ul></ul>之间则每个列表项加上一个圆点    
<div align=""></div> 用来排版大块HTML段落,也用于格式化表
<MENU> 选项清单
<DIR> 目录清单
<nobr></nobr> 强行不换行
<center></center> 水平居中

<a href="url">Link text</a>创建超文本链接
<img src="url" />插入图像 // <img src="boat.gif" alt="Big Boat">替换文本属性(Alt)// <img src="img.jpg" width="104" height="142" />
<table> 定义 HTML 表格 // <table border="1"> 拥有关于表格边框的附加信息。
<div></div>定义文档中的分区或节(division/section)。块级元素。它能够用作其他 HTML 元素的容器。
<span></span>定义 span,用来组合文档中的行内元素,能够用作文本的容器

1.哪些元素可以出现在 head 元素内

<base>, <link>, <meta>, <script>, <noscript> <style>, 以及 <title>

2.典型的可替换元素有

<img>, <object>, <video>和表单元素,如<textarea>, <input>

3.哪些元素的默认 display 为 block?

<div>, <ul>, <h1>

4.vs-code快速写代码:

div.red*10>a[href=#page$]{链接$}

5.<nav>nav bar,导航栏标签
<section>章节

6.有哪些标签里面不能有内容?即(空元素)
<img>, <input>, <meta>, <link>, <hr>, <br>, <col>, <colgroup>

7.关于<iframe><a>标签

<iframe src="https://www.baidu.com" name="xxx"></iframe>
<iframe src="./index.html" frameborder="0"></iframe>
  <a href="http://qq.com" target="_blank">QQ</a>
  <a href="http://qq.com" target="_self">QQ</a>
  <a href="http://qq.com" target="_parent">QQ</a>
  <a href="http://qq.com" target="_top">QQ</a>

8.关于<form>

如果<form>表单里没有提交按钮,你就无法提交这个<form>,除非你用JS

<form action="index.html" method="post" target="_blank">
    <input type="text" name="username">
    <input type="password" name="password">
    <input type="submit" value="提交">
</form>
<form action="index.html" method="post" target="_blank">
    <label>用户名:<input type="text" name="username"></label>
    <label>密码:<input type="password" name="password"></label>
    <input type="submit" value="提交">
</form>

<form>一般用来发post请求

9.关于<input>

1.<input type="buttom">

<input type="text" name="username">
<input type="password" name="password">
<button>按钮</button>

2.<input type="checkbox">多选框

喜欢的水果:
<label><input type="checkbox" name="fruit" value="orange">橘子</label>
<label><input type="checkbox" name="fruit" value="banana">香蕉</label>

3.<input type="radio">单选框

最喜欢的水果:
<label><input type="radio" name="fruit" value="orange">橘子</label>
<label><input type="radio" name="fruit" value="banana">香蕉</label>

4.<textarea>输入栏

<textarea style="resize: none;width: 100px;height: 50px; "name="个人介绍"></textarea>

5.<select>复式选择

  <select name="group">
        <option value="1">第一组</option>
        <option value="2">第二组</option>
        <option value="3" disabled>第三组</option>
        <option value="4" selected>第四组</option>
    </select>

6.<table>使用

<table>标签
<style>
    table{
        border-collapse:collapse;
}
</style>

设置border-collaps可使表格边框合并

10.写出一个 javascript 伪协议

javascript:;

end

上一篇下一篇

猜你喜欢

热点阅读