css类的两种使用方法

来源:互联网 发布:mysql 架构 编辑:程序博客网 时间:2024/06/05 06:08
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>


0 0
原创粉丝点击