css;js学习(一)
2024-09-05 09:14:52
推荐基础前端学习地址https://ke.qq.com/course/315961蝉壳学院
清除浮动
.clearfix:before,.clearfix:after{
content: "";
display: table;
}
.clearfix:after{
content: "";
display: block;
height:;
clear: both;
visibility: hidden;
overflow: hidden;
}
.clearfix{
*zoom: 1;
}
缺点:ie6;7,不支持 :after;使用zoom:1;触发haslayout
网页图标
<link rel="shortcut icon" href="img/bg-timg2.jpg" type="image/x-icon" />
div居中
.wrapper {
position: absolute;
top: 50%;
left: 50%;
margin-top: -250px;//div的高度的一半
margin-left: -200px;//div的宽度的一半
width: 500px;
height: 400px;
background: #fff;
border-radius:20px;
overflow: hidden;
}
z-index: 10;//层级
//转换数组
oSpan = Array.prototype.slice.call(document.getElementsByTagName("span")), //委托绑定元素事件
oUl.addEventListener('click', function (e) {
var target = e.target;
if(target.nodeName == 'LI'){
oCard.style.left = '100%';
oActive.innerHTML = target.innerHTML;
oActive.classList.remove('active');
}
})
demo地址https://pan.baidu.com/s/1VX6zgDaud5qjjlvYgCL3eQ 提取码:r5l6
最新文章
- jquery打造自定义控件(原创)
- Swift - 多行文本输入框(UITextView)
- 【Session】Tomcat中Session的外置
- iOS开发 Masonry的简单使用
- webpack 代码拆分,按需加载
- python学习-异常处理
- 链表(C++语言实现)
- OpenJudge计算概论-分配病房
- iOS开发——动画总结OC篇&;所有常用动画总结
- Android 自动编译、打包生成apk文件 4 - 多渠道批量打包
- 最短路之Floyd算法
- ES6之let命令
- Python练手例子(13)
- Python-正则表达式总结版
- MT【304】反射路径长度比
- 开源词袋模型DBow3原理&;源码(一)整体结构
- 使用CocoaPods来做iOS程序的包依赖管理
- To zero
- Ngxtop-Nginx日志实时分析利器
- windows下python安装Numpy和Scipy模块