什么是响应式Web设计?
- RWD指的是响应式Web设计(Responsive Web Design)
- RWD能够以可变尺寸传递网页
- RWD对于平板和移动设备是必需的
创建一个响应式设计:
<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
.city{
float:left;
margin:5px;
padding:15px;
width:300px;
height:300px;
border:1px solid black;
}
</style>
</head><body><h1>HTML Demo</h1>
<h2>Resize this reponsive page!</h2>
<br><div class="city">
<h2>Beijing</h2>
<p>Beijing is the capital city of China.</p>
</div><div class="city">
<h2>London</h2>
<p>London is the capital city of England.</p>
</div><div class="city">
<h2>Paris</h2>
<p>Paris is the capital city of France.</p>
</div></body>
</html>
运行结果:
