想咨询一下滚动条的问题

来源:5-12 项目作业

键盘f11

2020-08-16 15:57:50

http://img.mukewang.com/climg/5f38e18a093ea4ef03760375.jpg

http://img.mukewang.com/climg/5f38e18a098d466904190317.jpg

http://img.mukewang.com/climg/5f38e18a0979dcf903670428.jpg

http://img.mukewang.com/climg/5f38e18b0995f62904480244.jpg

http://img.mukewang.com/climg/5f38e18b098600af11010237.jpg

<!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结构,例如:

http://img.mukewang.com/climg/5f39ef350900ff2707540771.jpg

效果:
http://img.mukewang.com/climg/5f39ef4209164abf02650345.jpg

另外:如果想让老师测试你的代码,建议把代码粘贴上来(不要截图)。祝学习愉快~

0

键盘f11

提问者

2020-08-16

http://img.mukewang.com/climg/5f38e18b0995f62900000000.jpg

http://img.mukewang.com/climg/5f3932d509141aa803070327.jpg

http://img.mukewang.com/climg/5f3932d50942619703410273.jpg

http://img.mukewang.com/climg/5f3932d50963449b02640091.jpg

老师,您好,滚动条是出来了,但是这个滚动条的位置不是很正确,它这个滑动的区域包含了浅灰色的区域(更新时间8:30更新),这个位置不是很正确,滚动条的位置应该是稍微往下面移动一些的,但是这个滚动条的定位如何去调整呢?不是很调整的好,如果单纯的调整整个div容器的width数值和height数值,和项目作业中的要求不是很接近

0

好帮手慕言

2020-08-16

同学你好,可以给最外层的盒子设置overflow: auto;

http://img.mukewang.com/climg/5f38f2550980d1d703130145.jpg

效果如下:

http://img.mukewang.com/climg/5f38f2ea09b80b0902950293.jpg

如果想要去掉横向滚动条,可以把类名为.department-1元素的宽度调整小一些

如果我的回答帮到了你,欢迎采纳,祝学习愉快~

0

0 学习 · 14456 问题

查看课程