HTML基本标签

HTML基本标签

<h1>这是标题 1</h1> 

标题标签,h1最大,h6最小

这是一个普通的文本- <b>这是一个加粗文本</b>

部分加粗

&nbsp; 

空格

<br> 

换行

<hr>

水平线

<font size="6">This is some text!</font>
CSS 语法:<p style="font-size:20px">This is some text!</p>

文本标签。浏览器默认值是 3。

注意:HTML5 不支持 <font> 标签。请用 CSS 代替。

<img src="url" alt="替换文本" width="304" height="228">

图片标签

 <a href="url">链接文本</a>

链接标签

div

<div style="color:#0000FF">
  <h3>这是一个在 div 元素中的标题。</h3>
  <p>这是一个在 div 元素中的文本。</p>
</div>

span

<p>我有 <span style="color:blue;font-weight:bold">蓝色</span> 的眼睛</p>

容器标签:div用法span用法

 无序列表

<ul>
    <li>Coffee</li>
    <li>Tea</li>
    <li>Milk</li>
</ul>

有序列表:

<ol>
  <li>Coffee</li>
  <li>Tea</li>
</ol>
<ol start="50">
  <li>Coffee</li>
  <li>Tea</li>
</ol>
运行结果:
 1.Coffee
 2.Tea
50.Coffee
51.Tea
<ol type="I">
  <li>Coffee</li>
  <li>Tea</li>
</ol>

运行结果:
 I.Coffee
II.Tea

列表标签:

无序:<ul type="disc|circle|square">

实心圆(默认)|空心圆|实心方块

HTML5不再支持<ul> type 属性。请使用 CSS替代。

CSS 语法: <ul style="list-style-type:square">

 

有序:<ol type="1|a|A|i|I" start="">

<table border="1">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>

表格标签:<tr>表格行,<th>表头,<td>表格单元。

 

<form action="demo-form.php" method="get">
  First name: <input type="text" name="FirstName" value="Mickey"><br>
  Last name: <input type="text" name="LastName" value="Mouse"><br>
  <input type="submit" value="提交">
</form>

 表单标签:

用于登录和注册等位置,

单选复选按钮、下拉列表option

 

        <form method="post" action="URL" name="form2">
            <label>用户名:
                <input type="text" name="name1" value="value" />
            </label>
            <br />
            <label>密 码:
                <input type="password" name="pwd2" />
            </label>
            <br />
            <input type="submit" value="登录" />
        </form>

 标记标签label:方便文字在被点击时会聚焦到输入框

 

 

 

posted @ 2022-01-08 16:15  鹿先森JIAN  阅读(14)  评论(0编辑  收藏  举报