想咨询一下滚动条的问题
来源:5-12 项目作业
键盘f11
2020-08-16 15:57:50
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
.specialClinic{
width: 565px;
height: 90px;
margin: 0px;
float: right;
}
.departmentright{
float: right;
width: 270px;
height: 40px;
background-color: #f4f6fa;
line-height: 40px;
}
.depart-ment{
width:270px;
height: 285px;
float: right;
position: absolute;
left: 640px;
top: 23px;
}
.rule{
padding-left: 5px;
}
.rule a{
text-decoration: none;
color: #00b3ea;
font-size: 12px;
}
.time{
font-size: 5px;
padding-left: 5px;
padding-top: 10px;
}
.time1{
font-size: 5px;
padding-left: 5px;
padding-top: 5px;
}
.time-item{
text-decoration: none;
width: 100px;
height: 50px;
display: inline-block;
color: #888888;
font-size: 5px;
}
.time-item1{
position: absolute;
left: 65px;
top: 45px;
width: 20px;
height: 20px;
}
.time-item2{
position: absolute;
left: 65px;
top: 71px;
width: 20px;
height: 20px;
}
.time2{
padding-top: 25px;
}
.time-item3{
position: absolute;
left: 65px;
top: 99px;
width: 155px;
height: 20px;
}
.time-item4{
position: absolute;
left: 65px;
top: 138px;
width: 155px;
height: 20px;
}
.time-item5{
position: absolute;
left: 65px;
top: 165px;
width: 155px;
height: 20px;
}
.department-1{
width: 275px;
height: 240px;
overflow: auto;
}
.scrollbar{
overflow: auto;
margin: 50px auto;
}
</style>
</head>
<body>
<div class="depart-ment">
<div class="departmentright">
<div class="rule">预约规则<a href="">(更新时间每日8:30更新)</a></div>
</div>
<div class="department-1 scrollbar">
<p class="time1">预约周期:</p><a href="" class="time-item1 time-item">7天</a>
<p class="time">放号时间:</p><a href="" class="time-item2 time-item">8:30</a>
<p class="time">停挂时间:</p><a href="" class="time-item3 time-item">下午14:00停止次日预约挂号(周五14:00后停挂至下周一)</a>
<p class="time time2">退号时间:</p><a href="" class="time-item4 time-item">就诊前一工作日14:00前取消</a>
<P class="time">特殊规则:</P><a href="" class="time-item5 time-item">1.取号地点不同:西院区预约号取号地点:西院区门诊楼一层大厅挂号窗口取号。东院区老门诊楼一层大厅挂号窗口或新门诊楼各楼层挂号/收费窗口取号。</a>
</div>
</div>
</body>
</html>
老师,您好,我想咨询一下为什么我的滚动条出不来呢?滚动条是默认样式,项目作业中右侧下方的内容需要有滚动条,不知道什么原因,我这边显示不了是什么原因呢?上述为我截取的部分代码内容
3回答
好帮手慕言
2020-08-17
同学你好,可以调整下html结构,例如:
效果:
另外:如果想让老师测试你的代码,建议把代码粘贴上来(不要截图)。祝学习愉快~
键盘f11
提问者
2020-08-16
老师,您好,滚动条是出来了,但是这个滚动条的位置不是很正确,它这个滑动的区域包含了浅灰色的区域(更新时间8:30更新),这个位置不是很正确,滚动条的位置应该是稍微往下面移动一些的,但是这个滚动条的定位如何去调整呢?不是很调整的好,如果单纯的调整整个div容器的width数值和height数值,和项目作业中的要求不是很接近
好帮手慕言
2020-08-16
同学你好,可以给最外层的盒子设置overflow: auto;
效果如下:
如果想要去掉横向滚动条,可以把类名为.department-1元素的宽度调整小一些
如果我的回答帮到了你,欢迎采纳,祝学习愉快~
相似问题