老师看下对吗?

来源:2-7 编程练习

我不是胖球球

2021-09-16 00:05:45

相关代码:

<!DOCTYPE html>
<html lang="zh-CN">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

.text-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}

.text-box {
width: 300px;
margin: 20px auto;
padding: 20px;
border: 1px solid rgb(224, 217, 217);
}

.text-box p {
border-bottom: 1px dashed rgb(233, 230, 230);
line-height: 20px;
font-size: 10px;
font-weight: bold;
color: rgba(109, 104, 104, 0.883);
}
</style>
</head>

<body>
<div class="text-box">
<p class="text-ellipsis">最强折叠屏手机来袭,三星Galaxy Fold引领潮流风尚</p>
<p class="text-ellipsis">我国双层高铁测试完毕,二等座载客量提升33%,还能进一步升级</p>
<p class="text-ellipsis">中央文件:规划发展雄安新区教育,有限发展教育事业</p>
<p class="text-ellipsis">2019春节红包大战分析 :春晚合作伙伴身份直接公布</p>
<p class="text-ellipsis">2.25福宝精粹:免费领联通500M流量、百度一下</p>
</div>
</body>

</html>


写回答

1回答

好帮手慕星星

2021-09-16

同学你好,代码实现效果可以。

优化:样式结尾记得加分号,规范一些

https://img.mukewang.com/climg/6142a016097d544204770146.jpg

祝学习愉快!

0

0 学习 · 15276 问题

查看课程