HTML标签、属性五

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>背景</title>
  <style>
    .box1 {
      width: 200px;
      height: 200px;
      border: 10px double #f00;
      padding: 20px;
      background-color: pink;
      background-image: url(./img/1.jpg);
      background-repeat: no-repeat;
      /* background-position: top right; */
      background-position: 20px 20px;
      background-clip: content-box;
      background-origin: padding-box;
      background-size: contain;
    }
    .box2 {
      width: 200px;
      height: 200px;
      background-image: linear-gradient(200deg, red, yellow, blue);
    }
    table {
      width: 50%;
      border: 1px solid #000;
      /* border-spacing: 0; */
      border-collapse: collapse;
    }
    td, th {
      border: 1px solid #000;
    }
  </style>
</head>
<body>
  <div class="box1"></div>
  <div class="box2"></div>
  <table>
    <tr>
      <th>1</th>
      <th>2</th>
      <th>3</th>
      <th>4</th>
    </tr>
    <tr>
      <td>A1</td>
      <td>B1</td>
      <td>C1</td>
      <td>D1</td>
    </tr>
    <tr>
      <td>A2</td>
      <td>B2</td>
      <td>C2</td>
      <td>D2</td>
    </tr>
    <tr>
      <td>A3</td>
      <td>B3</td>
      <td>C3</td>
      <td>D3</td>
    </tr>
  </table>
  <form action="./单位.html">
    用户名<input type="text" name="username">
    密码<input type="password" name="password">
    单选框:<input type="radio" value="a" checked>
    <input type="radio" value="b">
    复选框:<input type="checkbox">
    <input type="checkbox">
    <input type="checkbox">
    提交<input type="submit" value="登录">
  </form>
</body>
</html>

标签

  • table标签:tr一行;td一个单元格;th第一行单元格;table里面可以分为三部分,thead、tbody、tfoot;

    • border-spacing:指定边框之间的距离;
    • border-collapse:collapse;边框的合并;
    • 表格没有使用tbody而是直接使用tr,浏览器会自动创建一个tbody,并将tr全部放在tbody中,所以tr不是table的子元素;
    • display:table-cell;将元素设置为单元格;
  • form表单:用于提交数据;将网页中的数据提交到远程的服务器;

    • 属性action表单要提交的服务器地址,必须有;
    • 表单项:input(要写个name属性);type=text/submit(value="")/password/radio(单选按钮,必须要有相同的name属性,要指定value属性,checked,将按钮设置为默认选中)/checkbox(复选框)
    • select>option;下拉选择;

背景

  • background-repeat:设置重复方式;repeat默认值;repeat-x沿着x轴重复;repeat-y沿着y轴方向重复;no-repeat不重复;
  • background-position:top、left、bottom、center,必须指定两个,也可以使用偏移量来设置;、
  • background-clip:背景裁剪;baoder-box默认,背景会显示在边框下;padding-box背景不会出现在边框,会出现在padding和内容区;content-box:只会出现在内容区;
  • background-origin:背景图片的偏移量的原点;padding-box:默认,backgroun-position从内边距处开始计算;content-box:从内容区计算;border-box:从边框处计算;
  • background-size:背景图片大小;设置一个值或者两个值;cover:图片比例不变,将元素铺平;contain:比例不变,图片在元素中完整显示;
  • background-attachment:背景图片是否跟随元素移动,scroll:默认,会跟随元素移动;fixed:背景会固定在页面中,不会移动;
  • 简写属性:background:color image position/size repeat origin clip;
  • ctrl+f:强制清除缓存;
  • 渐变颜色:background-image来设置:linear-gradient(方向,#111, #222)线性渐变,方向有to left,to right,to bottom,to top,也可以0-1turn,0-360deg;repeating-linear-gradient()线性重复渐变;redial-gradient(大小(可以是偏移量,circle,ellipse),位置(top,right……),颜色,颜色)径向渐变(默认正方形圆形,长方形椭圆形);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值