上一页 1 ··· 7 8 9 10 11 12 下一页
float浮动:会脱离标准流,影响:1. 不保留原位置,因此父元素不设置高度则无法被撑大2. 同级元素应该也浮动,否则布局可能会出现问题清除浮动方法:1. W3C推荐做法:在浮动元素最后添加一个块级标签,css样式设置clear: both;兼容性好,但每次都会多添加一个块级标签,影响代码结构2. Read More
posted @ 2021-09-10 16:44 TwinkleG Views(72) Comments(0) Diggs(0)
1. 使用浮动float,左右分别左浮动和右浮动,中间元素设置margin实现自适应 <div class="box"> <div class="left">左边</div> <div class="right">右边</div> <!-- center未脱标,如果标签放在中间,会把right挤到下 Read More
posted @ 2021-09-10 16:07 TwinkleG Views(477) Comments(0) Diggs(0)
div水平居中:1. margin: 0 auto2. 定位 position: absolute;left: 50%;transform: translateX(-50%);3. flex布局display: flex;justify-content: center;div垂直居中:1. posi Read More
posted @ 2021-09-10 15:51 TwinkleG Views(32) Comments(0) Diggs(0)
1. !important > inline > id > class > tag > * > inherit > default 2. 权重值对比: !important 最大 inline 行内样式 1000 id选择器 100 class选择器 10 标签 1 通配符选择器 0 *** 通配符 Read More
posted @ 2021-09-10 15:41 TwinkleG Views(31) Comments(0) Diggs(0)
flex布局又称作弹性盒布局,其由两部分组成,首先是弹性盒【flex-container】,其次是弹性子元素【flex-items】 注意:在webkit内核中的flex布局需要加前缀:-webkit-flex 1. flex-container常见属性: 1. flex-direction: ro Read More
posted @ 2021-09-10 15:25 TwinkleG Views(353) Comments(0) Diggs(0)
1. 行内元素: 常见标签有:a、span、sub、sup、br、strong、b、em、i、label 特点:【1】一行内可以存在多个 【2】无法设置width、height,padding、margin值不能设置垂直方向,只可以设置水平方向,可以设置line-height 【3】一个行内元素内可 Read More
posted @ 2021-09-09 21:18 TwinkleG Views(6113) Comments(0) Diggs(0)
1. instanceof可用于判断某个实例是否属于某构造函数 或者 在继承关系中用来判断一个实例是否属于它的父类型或者祖先类型的实例 2. 思路:获取目标类型的显式原型prototype以及需要判断的实例的隐式原型__proto__,将实例按原型链一级一级判断, 直到__proto__为null, Read More
posted @ 2021-09-09 16:53 TwinkleG Views(376) Comments(0) Diggs(0)
1. Promise基本使用: 【1】Promise:两个实例参数,分别为PromiseState和PromiseResult,前者表示Promise状态,后者表示改变状态时传入的data数据. const p = new Promise((resolve, reject) => { resolve Read More
posted @ 2021-09-08 21:02 TwinkleG Views(536) Comments(0) Diggs(0)
在Vue CLI2 中, 参考视频:https://www.bilibili.com/video/BV1fv411C72r?p=141 webpack.base.config.js,module.exports = { ... resolve: { alias: { // 起别名 '@': reso Read More
posted @ 2021-08-24 12:08 TwinkleG Views(196) Comments(0) Diggs(0)
1. 基本使用 axios({ url: 'https://www.baidu.com', // 仅仅作为示例,这个地址跨域请求会被拦截 params: { // params应用于GET请求,会被拼接到地址最后,eg: https://www.baidu.com?type=nothing&page Read More
posted @ 2021-08-24 12:04 TwinkleG Views(182) Comments(0) Diggs(0)
上一页 1 ··· 7 8 9 10 11 12 下一页