03 2022 档案
摘要:一、代码: <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
阅读全文
摘要:一、 人麻了,没想到这么复杂,搞了半天也才凑合的水平。 以下为自己编写的代码: <!DOCTYPE html>· <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE
阅读全文
摘要:1. 学会用 nav 制作导航栏; 2. 居中设置:margin : xpx auto ; 3. 去掉下划线:text-decoration ; 4. 文字垂直居中:line-hight: x px,这里的x设置为与父元素的行高(hight)一样的数值 ; 效果图(因为不会弄动图所以看不了动态效果,
阅读全文