练习4-3:做完练习永远不知道对不对(/抓狂)
来源:4-3 编程练习
再见1900
2020-09-18 15:47:47
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>文本样式</title>
<style type="text/css">
/*写出CSS样式*/
div{
background:#eee;
text-align:center;
font-size: 2em;
line-height: 5em;
}
.one{text-align:center;}
.two{
font-size: 2em;
}
.three{
color:red;
text-decoration:underline;
text-align:center;
text-transform: capitalize;
}
</style>
</head>
<body>
<!--写出html代码-->
<div>
<p>
<span class="one"><img src=" http://climg.mukewang.com/59c21bae000157fa01000059.jpg"></span>
<span class="two">CSS层叠样式表</span>
<span class="three">(cascading style sheets)</span>
</p>
</div>
</body>
</html>
1回答
同学你好,页面效果中,英文字母没有相对于“层叠样式表”居中显示,建议给图片、汉字、英文都设置vertical-align: middle;让它们三个都垂直居中,那么彼此就会居中。
参考下图:

同学做完练习不要抓狂呀,如果不知道代码效果对不对,可以把代码粘贴上来,老师来帮你查看效果,同学也可以根据练习题给出的效果图来进行对比哦。
如果帮助到了你,欢迎采纳,祝学习愉快~
相似问题