老师为什么我的class="two"英文首字母没有大写还有并且没有继承父元素的字符集
来源:4-3 编程练习
慕运维1089
2019-06-15 21:24:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>文本样式</title>
<style type="text/css">
/*写出CSS样式*/
p{background:#eee;height:5em;font-size:2em;line-height:5em;text-align:center;}
.one{font-size:2em;font-family:"宋体";sans-serif}
.two{color:red;vertical-align:top;text-transform:capitalize; text-decoration:underline;}
</style>
</head>
<body>
<!--写出html代码-->
<p>
<img src="http://climg.mukewang.com/59c21bae000157fa01000059.jpg"><span class="one">CSS层叠样式表</span><span class="two">(cascading style sheets )
</span>
</P>
</body>
</html>
1回答
樱桃小胖子
2019-06-16
1、没有继承父元素的字体是因为你给one设置了字体,但是one并不是two的父级元素
因此,需要给父级元素p设置。class=“two”的元素才能继承
2、首字母没有变成大写,是因为标点符号书写错误导致的
希望可以帮到你!
相似问题