您的位置:首页 > Web前端 > CSS

css类的两种使用方法

2015-10-20 13:16 537 查看
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>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  css html