html
<textarea rows="5" cols="30"> </textarea>多行文字输入区 行数 列数<tr>行<td>列<th>表头第一行display:box主要是控制父容器里面子元素的排列方式、排列顺序、垂直(水平)对齐方式
输入框
input type="checkbox"(radio/file)复选框,单选框,文件
链接
<a href="#"></a>给<a></a>中间的元素加上链接
<img src=""width="" height="" alt="">在该位置插入图片
css样式
字体样式
font-size:12px;字体大小
font-weight:bold;加粗字体
font-style:italic;斜体
line-height:20px;行高
text-decoration:underline;设置下划线(none无任何装饰)
font-indent:40px;首行缩进(em/px)
text-align:right;设置文字对齐方式left/center)
背景样式
background:url("");设置背景图
background-color:red;背景颜色
background-size:20px;设置图片大小
border:10px solid red;设置边框宽度样式颜色(none无边框)
background-position:center;图片位置(20px 0)
边距块
css:
*{margin:0;padding:0;}
margin-top:0px;顶部外边距(left/right/bottom)
margin:0px 0px 0px 0px;设置上右下左外边距
padding-top:0px;顶部内距离(left/right/bottom)
margin:auto;水平居中
disply:block;块
li{
list-style:square;}列表样式,实现实心正方圆
border-radius:value 四个边都会改变
可以单独改变一边
border-top-left-radius: value;
border-top-right-radius:value;
border-bottom-left-radius:value;
border-bottom-right-radius:value;
box-shadow可以给元素添加阴影
box-shadow: h-shadow v-shadow blur spread color inset;
*h-shadow*
必需 水平阴影的位置。允许负值。
*v-shadow*
必需。垂直阴影的位置。允许负值。
*blur*
可选。模糊距离。
*spread*
可选。阴影的尺寸。
*color*
可选。阴影的颜色。请参阅 CSS 颜色值。
inset
可选。将外部阴影 (outset) 改为内部阴影。
伪元素
.xiang: hover{}鼠标移动到时显示的样式
cursor:pointer;手
html:
块标签(独占一行,能设置高宽等)
<div></div>
<p></p>
<hl></hl>
<ul>
<li></li>
</ul>
内联标签(无法设置高宽等)
内联标签(无法设置高宽等)
<strong></strong>加粗
<i></i>倾斜
<em></em>倾斜
<span></span>能并排显示的块(不能设置高宽)
<a href="#"></a>链接
内联块()
内联块()
<input type="text">输入框
<button></button>按钮
<img src=""alt="">插入图片
<hr/>分割线
<br/>换行
html常用快捷键
!+tab头文件
shift+alt+f格式化代码
alt+b快速打开
ctrl+/注释
ctrl+\分页
shift+1等于"!"
html语法
<p>不可以套div li可以套div
嵌入样式
css样式<link rel="stylesheet" href="css/style.css">
html直接加格式
<table >
动画
样板(水平垂直移动)
.tt-height>img:hover{
transform: translateY(-20px);
box-shadow: 0 0 1px 1px rgb(211, 178, 70);
}
轮播图(案例)
<div class="content">
<div id="list">
<img src="images/01.png" alt="">
<img src="images/02.png" alt="">
<img src="images/03.png" alt="">
<img src="images/04.png" alt="">
<img src="images/05.png" alt="">
</div>
<button id="prev"></button>
<button id="next"></button>
<div id="btns">
<span class="current"></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</div>
<script>
// 往右
var index=0;
$("#next").click(function()
{
index++;
if(index>4){
index=0;
}
console.log(index)
$("#list img").eq(index).fadeIn().siblings().fadeOut()
$("#btns span").eq(index).addClass("current").siblings().removeclass("current");
})
// 往左
$("#prev").click(function()
{
index--;
if(index<0){
index=4;
}
console.log(index)
$("#list img").eq(index).fadeIn().siblings().fadeOut()
$("#btns span").eq(index).addclass("current").siblings().removeclass("current");
})
// 点击焦点换图
$('#btns span').click(function(){
// 重置下标值
index = $(this).index();
$("#list img").eq(index).fadeIn().siblings().fadeOut()
$("#btns span").eq(index).addClass("current").siblings().removeClass("current");
})
