老师请看看我的代码

来源:4-1 css文本样式应用

慕村6371425

2020-06-17 17:32:49

<!doctype html>

<html>

<head>

<meta charset="UTF-8">

<title>ÎÞ±êÌâÎĵµ</title>

<style>

div {display:table; width:100%;}

p {background:#ececec; height:150px; width: 100%; display:table-cell; vertical-align:middle;text-align:center;}

.a {color:red; font:bold 80px "宋体",serif; color:#751617;}

.b {color:orangered; font:lighter 30px/80px "微软雅黑"; letter-spacing:5px; text-decoration:underline; text-decoration-color: aqua;

vertical-align:15px;}

.c {font-style:oblique; font-size:80px; color:gray;}

</style>

</head>


<body>

<div>

<p><span class="a">慕课网</span>&nbsp;&nbsp;&nbsp;<span class="b">只学有用的</span><span class="c">!</span></p>

</div>

</body>

</html>

问问为什么我在span标签添加text-indent没有效果,text-indent不是行内和块元素都可以用的吗?

写回答

1回答

好帮手慕慕子

2020-06-17

同学你好,代码是在正确的,效果实现的很棒。

针对问题解答如下:因为span是行内元素,所以设置text-indent属性无效。

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

0

0 学习 · 40143 问题

查看课程