css类的两种使用方法

eg1:
<!DOCTYPE html>
<html>
<head>
<style>
p {text-indent:50px;}
</style>
</head>
<body>

<p>In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. 'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'</p>

</body>
</html>
			

eg2:

<!DOCTYPE html>
<html>
<head>
<style>
img.top {vertical-align:text-top;}
img.bottom {vertical-align:text-bottom;}
</style>
</head>

<body>
<p>An <img src="logo.png" alt="w3cschool" width="270" height="50" /> image with a default alignment.</p> 
<p>An <img class="top" src="logo.png" alt="w3cschool" width="270" height="50" /> image with a text-top alignment.</p> 
<p>An <img class="bottom" src="logo.png" alt="w3cschool" width="270" height="50" /> image with a text-bottom alignment.</p>
</body>
</html>
			


相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页