老师,您看看这样对吗,另外,“为图片设置样式,图片要针对与“CSS层叠样式表”居中显示”是什么意思呢
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>文本样式</title>
<style type="text/css">
/*写出CSS样式*/
p{background-color:#eee;
text-align:middle;
font-size:2em;
line-height:5em;
}
.img{text-align:middle;}
.text1{font-size:2em;}
.text2{
text-align:middle;
color:red;
text-decoration:underline;
}
</style>
</head>
<body>
<!--写出html代码-->
<div>
<p>
<span class="img">
<img src="http://img1.sycdn.imooc.com/climg//59c21bae000157fa01000059.jpg" alt="css"/>
</span>
<span class="text1">CSS层叠样式表</span><span class="text2">(Cascading Style Sheets)</span></p>
</div>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星