HTML知识

列表标签

  • ul 无序 >li ul :unorder list
    <ul>
      <li>oppo</li>
      <li>vivo</li>
    </ul>
    
  • ol 有序>li ol:order list
  • **自定义列表 **
    <dl>
      <dt>这是列表标题</dt>
      <dd>内容1</dd>
      <dd>内容2</dd>
    </dl>                   dl中只能包含dt/dd标签
    

表格标签

  • 表格标签

    <table border="1" width="300" height="300">  
    <tr>
      <td>姓名</td>
      <td>成绩</td>
    </tr>
    <tr>
      <td>小张</td>
      <td>100</td>
    </tr>
    </table>
    
  • 表格标题、表头

    caption 标题 
    th:table head 表头
    <table border="1" width="300" height="300">  
      <caption>学生成绩</caption>
    <tr>
      <td>姓名</td>
      <td>成绩</td>
    </tr>
    <tr>
      <td>小张</td>
      <td>100</td>
    </tr>
    </table>
    表头 
    <table border="1" width="300" height="300">  
      <caption>学生成绩</caption>
    <thead>
      <tr>
        <td>姓名</td>
        <td>成绩</td>
      </tr>
    </thead>
    <tr>
      <td>小张</td>
      <td>100</td>
    </tr>
    </table>
    
  • 合并单元格

    rowspan:合并行   水平方向合并
    colspan:合并列 column span 竖直方向合并
    

表单标签

  • input标签
    文本框<input type="text"> 
      placeholder 占位符 <input type="text" placeholder="请输入信息">
      
    密码框<input type="password">
    
    单选框<input type="radio">   默认选中为checked
    相同name下只能选一个
    性别:<input type="radio" name="sex" >男 
        <input type="radio" name="sex" checked >女
    
    复选框<input type="checkbox"> 默认选中为checked
    
    上传文件<input type="file">
    <input type="file" multiple> 选中多个文件
    
    按钮要放到表单中
     提交按钮<input type="submit" value="提交按钮">
    
    重置按钮<input type="reset" value="重置按钮">
    
    普通按钮<input type="button" value="普通按钮">
    

form表单,按钮要放到表单中

 <form action="">
        用户名: <input type="text">
        <br>
        <br>
        密码: <input type="password">
        <br>
        <br>
        <!-- 按钮 -->
        <input type="submit" value="免费注册">
        <input type="reset">
        <input type="button" value="普通按钮">
        
    </form>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Echmp0PC-1685685529355)(7734dbbbb4174bf7e6879aaa280ea794.png)]

button按钮标签

  • 和input一样
    • 谷歌浏览器中button默认是提交按钮
    • button标签是双标签,更便于包裹其他内容:文字、图片等
    
        <button type="submit">提交按钮</button>
        <button type="reset">重置按钮</button>
        <button type="button">普通按钮, 没有任何功能</button>
    

select下拉菜单标签

  • <select>
    <option selected>杭州</option>  表示默认选择杭州
    <option>上海</option>
    <option>北京</option>
    <option>广州</option>
    </select>
    

textarea文本标签

  •  <textarea cols="60" rows="30" placeholder="请输入文本"></textarea>
    
    

label标签

  • 用于绑定内容与标签
    方法一:<input type="radio" name="sex" id="male" ><label for="male">男</label> 
    方法二:<label> <input type="radio" name="sex" checked >女</label>
    

布局标签

  • <div>大盒子
    <span>小盒子
    

字符实体

  • 空格问题 ,html代码中出现多个空格、缩进、换行等只会出现一个空格
  • 空格 &nbsp;
    小于号 < &lt;   less than
    大于号 > &gt;  greater than
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值