摘要:
一、有关背景 1. background - color 2. background - size : - 设置图片大小,宽+高(只写一个,另一个默认为auto) - cover:图片比例不变,将元素铺满,但有可能显示不全; - contain :图片比例不变,完整显示图片 3. backgroun 阅读全文
摘要:
一、初次尝试 1. 自己编写的代码以及效果图: <link rel="stylesheet" href="C:\data\计算机学习\index3.html\02.CSS\reset.css.css"> <link rel="stylesheet" href="C:\data\计算机学习\index 阅读全文
摘要:
一、iconfont 具体见第79节 二、行高 line - height 1. 指的是文字占有的实际高度; 2. 可以指定一个大小(px),也可以设置一个整数,此时行高是字体的倍数; 3. 行高会在字体框上下平均分配(字体框:字体所在的格子,设置 font-size 实际上就是在设置字体框高度); 阅读全文
摘要:
一、代码: <style> .img-list{ position: relative; } .img-list{ height: 470px; width: 590px; margin: 100px auto; } .img-list li{ position: absolute; } .img- 阅读全文
摘要:
<style> .box1{ width: 600px; height: 600px; background-color: #bfa; position: relative ; } .box2{ width: 100px; height: 100px; background-color: tomat 阅读全文
摘要:
一、定位 position 定位: -是一种更高级的布局手段; -使用 position 属性来设置; 可选值: static默认值;(不开启定位) relative 开启相对定位 absolute 开启绝对定位 fixed 开启元素的固定定位 sticky 开启元素的粘滞定位 二、 相对定位 po 阅读全文
摘要:
不管是遇到外边距重叠或者高度塌陷问题,都可以用 clearfix 解决: <style> .clearfix : : before , .clearfix : : after{ display : table ; content : ' ' ; clear : both ; } </style> 原 阅读全文
摘要:
一、使用 clear 解决 1.clear 简介: 给一块元素设置 clear 属性后,将消除它上面元素因浮动对它造成的影响。(可选值:left,right,both) For example: <style> .box1{ width: 200px; height: 200px; backgrou 阅读全文
摘要:
一、盒子的尺寸 1. 默认情况下,盒子可见框大小由内容区、内边距和边框共同决定; 2. box-sizing 用来设置盒子尺寸的计算方式(即 width 和 height 的作用) 可选值有 content - box:宽高用来设置内容区大小; border - box : 宽高用来设置整个盒子的可 阅读全文
摘要:
1. 在浏览器中弹出警告框: alert(" xxxx") ; 2. 在浏览器中显示内容:document.write("xxxx") ; 3. 向控制台输出一个内容:console.log("xxxx") ; 4. script 标签有两个作用,一是可以在里面编写代码,如alert等;二是像CSS 阅读全文