11种常用css样式之鼠标、列表和尺寸样式学习

时间:2024-06-08 20:05:38

鼠标cursor常见样式crosshair;/*十字形状*/cursor:pointer;/*小手形状*/cursor:wait;/*等待形状*/cursor:text;/*默认 文本形状*/cursor:default;/*箭头指示形状*/cursor:help;/*帮助形状*/
列表(list-style-type):none/*把列表前面的选项去除*/disc/*实心*/circle/*空心*/square/*方块*/decimal/*序列*/lower-roman/*小写罗马*/upper-roman/*大写罗马*/lower-alpha/*小写字母*/upper-alpha/*大写字母*/ 
尺寸:height;max-height;min-height;width;max-width;min-width/*屏幕自适应宽度,100%*/textarea文本框:resize:none/*文本框不能拖动*/width:500px;height:300px;样式继承:文字有关的样式会继承下来(阅读css常用样式font控制字体的多种变换)文本框resize:none文本框不能拖动)样式继承/*文字有关的样式会继承下来*/阅读"css常用样式font控制字体的多种变换"

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>11种常用css样式之鼠标、列表和尺寸样式学习</title>
<style type="text/css">
/*常见鼠标样式*/
#ceshi{
/* width: 120px;
height: 20px;
line-height: 20px;
text-align: center;
border-radius: 5px;
color: #fff;
border: 1px inset red;
background-color: green; */
cursor: crosshair;/*十字架*/
cursor: text;/*默认 文本*/
cursor: wait;/*等待加载*/
cursor: help;/*请求帮助*/
cursor:default;/*箭头指示*/
cursor: pointer;/*小手*/
}
/*常见列表样式*/
.box>ul li{
list-style: none;/*把列表前面的选项去除*/
list-style-type: disc;/*实心圆点*/
list-style-type: circle;/*空心圆点*/
list-style-type: square;/*方块*/
list-style-type: decimal;/*序列123..*/
list-style-type: lower-alpha;/*小写字母*/
list-style-type: upper-alpha;/*大写字母*/
list-style-type: lower-latin;/*小写字母*/
list-style-type: lower-roman;/*小写罗马*/
list-style-type: upper-roman;/*大写罗马*/
}
.box>ul li>a{
text-decoration: none;
}
/*拓展,字母大小写、文本默认方向;建议阅读“css常用样式对文本的处理演练”*/
p{
direction: ltr;
text-transform: uppercase; /*全部大写*/
text-transform: lowercase;
text-transform: capitalize;
}
/* 尺寸 如何清理浮动阅读https://www.cnblogs.com/dhnblog/p/12313037.html*/
.size{
background-color: #000;
}
.size>ul{
width: 1920px;
min-width: 1300px;/*屏幕自适应宽度100%*/
padding-left: 0;
padding-right: 40px;
line-height: 40px;
}
.size>ul>li{
list-style-type: none;
float: left;
margin-left: 15px;
}
.size>ul>li>a{
text-decoration: none;
color: #fff;
}
.size::after{
content: '';
clear: both;
display: block;
}/*清浮动*/
#ueser{
width: 100px;
height: 100px;
resize: none;/*不能拖动*/
}
</style>
<script>
window.onload=function(){
var obj=document.getElementById('ceshi')
obj.onclick=function(){
console.log('123');
alert('f12打开控制台');
document.body.style.background='#f90'
}
}
</script>
</head>
<body>
<div id="ceshi">
点我有惊喜
</div>
<div class="box">
<ul>
<li><a href="#">列表abc1</a></li>
<li>列表abc2</li>
<li>列表abc3</li>
<li>列表abc4</li>
<li>列表abc5</li>
</ul>
</div>
<p>asAAAAdbc</p>
<!-- 尺寸 使用ul制作一个导航菜单-->
<div class="size">
<ul>
<li><a href="#">百度</a></li>
<li><a href="#">新浪</a></li>
<li><a href="#">搜狐</a></li>
<li><a href="#">网易</a></li>
<li><a href="#">考拉</a></li>
</ul>
</div>
<!-- textarea文本框 -->
<form action="">
<p>用户名:</p><input type="text" name="">
<p>留言信息:</p>
<textarea name="" id="ueser" cols="30" rows="10" ></textarea>
</form>
<!-- 样式继承 文字有关的样式会继承下来 -->
</body>
</html>