不知道代码哪里错了没效果?小型大写字母是不是代码中敲大写的?是不是除第一位以外小型?

来源:2-19 编程练习

迷失的小麦

2019-10-29 11:44:28

<!DOCTYPE html>

<html>

    <head>

    <meta charset="UTF-8">

    <title>伪类选择器</title>

    <style type="text/css">

p:first-child{font: italic small-caps bold;color: red;}

p:last-child{color: blue;font-weight: bold;font-variant: small-caps;}

    </style>

</head>

<body>

<p>Web前端攻城狮(WEB front siege lion)</p>

<p>CSS层叠样式表(Cascading Style Sheets)</p>

</body>

</html>


写回答

2回答

好帮手慕码

2019-10-29

同学你好!

font简写形式,只有把font-size和font-family都写上才会生效。你这里没有写,建议修改如下:

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

第一句首字母大写即可:

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

如果帮助到了你,欢迎采纳,祝学习愉快~

0

总是很饿

2019-10-29

p:first-child{font: italic small-caps bold;color: red;}

此行,font属性简写需同时出现font-size、font-family属性才能起效,另外注意不同属性的顺序。小型大写字母代码中为小写,使用font-variant:small-caps属性后小写变为大写但与普通大写字母相比偏小。

0

0 学习 · 40143 问题

查看课程