博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
前端常见问题(一)
阅读量:7220 次
发布时间:2019-06-29

本文共 1335 字,大约阅读时间需要 4 分钟。

【CSS】

  • 上下、左右居中一个元素,适用于任何场景

  • position有哪些值

    • static: 默认值。没有定位,元素出现在正常的流中(top right bottom left 和 z-index对这样的元素无效)
    • relative: 相对定位。相对其正常位置进行定位,元素位置由top right bottom left 和 z-index决定
    • absolute: 绝对定位。相对于第一个不是static定位的父元素定位,元素位置由top right bottom left 和 z-index决定
    • fixed: 绝对定位。相对浏览器窗口进行定位,元素位置由top right bottom left 和 z-index决定
    • inherit: 继承父元素的position属性值
  • 谈谈盒子模型(标准和IE)

    div {    margin: 10px;    border: 1px solid red;    padding: 5px;    width: 50px;    height: 30px;    background: pink;  }复制代码
    • 标准盒子模型:

    • ie盒子模型:

  • 怎么用css画一个三角形

    html

    复制代码

    css

    div {    width: 0;    height: 0;  }  .triangle1 {    border-top: 100px solid red;    border-right: 100px solid blue;    border-bottom: 100px solid goldenrod;    border-left: 100px solid pink;  }复制代码
  • 怎样实现一个盒子里两个div,左边固定宽度,右边自适应宽度

    html

    复制代码

    css

    // 通用的 .parent {    width: 100%;    height: 100px;  }  .left {    width: 100px;    background: pink;    height: 100%;  }  .right {    background: palegreen;    height: 100%;  }  /* 法1 左边浮动 */  .left {    float: left;  }  /* 法2 左边绝对定位 */  .parent {    position: relative;  }  .left {    position: absolute;  }  .right {    width: calc(100% - 100px);    margin-left: 100px;  }  /* 法3 右边绝对定位 */  .parent {    position: relative;  }  .right {    position: absolute;    width: calc(100% - 100px);    left: 100px;    top: 0;  }复制代码

转载地址:http://kihym.baihongyu.com/

你可能感兴趣的文章
windows10安装体验(win8.1升级win10)
查看>>
Eclipse插件checkstyle安装使用
查看>>
使用Volley传送网络数据
查看>>
centos下的tree的使用
查看>>
笔记本在公司内部分工位有线连接不识别无法上网
查看>>
Windows 8 Hyper-v和MinWin:一个扭转战局的策略?
查看>>
mybatis问题
查看>>
__attribute__ 你知多少?
查看>>
Android Bluetooth 学习(3)蓝牙设备之间自动配对
查看>>
调用系统相册和拍照,取得返回文件
查看>>
android View 1
查看>>
Zabbix 监控windows的网卡流量
查看>>
Oracle 查询当前系统时间的几种方式
查看>>
python 爬虫系列(1) --- requests库入门
查看>>
使用Apache Httpclient访问Spring rest接口下载文件
查看>>
机器学习算法中的准确率(Precision)、召回率(Recall)、F值(F-Measure)
查看>>
Dockerfile多阶段构建
查看>>
MySQL配置文件mysql.ini参数详解
查看>>
通知UI thread的一个方法
查看>>
offsetof宏—求结构体中一个成员在该结构体中的偏移量
查看>>