您的位置:首页 > 其它

block & inline

2015-09-20 22:33 232 查看
1. block 整体

<div> , <h1> , <p> , <form> 

2. inline 一句话的一部分

<span> , <a> , <img>

3. <body>

<div style="background-color:black; color:white; padding:20px;">

<h2>London</h2>

<p>London is the capital city of England.</p>

</div> 

</body>

4. <body>

<h1>My <span style="color:red">Important</span> Heading</h1>

</body>

5. 用class来解决多个相同样式的block

<head>

<style>

div.cities {

    background-color:black;

    color:white;

    margin:20px;

    padding:20px;

}

</style>

</head>

<body>

<div class="cities">

<h2>London</h2>

<p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>

<p>Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.</p>

</div>

</body>

6. 用class来解决多个相同样式的inline

<head>

<style>

span.note {font-size:120%;color:red;}

</style>

</head>

<body>

<h1>My <span class="note">Important</span> Heading</h1>

<p>This is some <span class="note">important</span> text.</p>

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