在W3Sshool学习HTML关于响应式web设计的疑问。

为什么下面这段能够实现 响应式web.

<!DOCTYPE html>

.city { float: left; margin: 5px; padding: 15px; width: 300px; height: 300px; border: 1px solid black; }

W3School Demo

Resize this responsive page!


London

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.

Paris

Paris is the capital and most populous city of France.

Tokyo

Tokyo is the capital of Japan, the center of the Greater Tokyo Area, and the most populous metropolitan area in the world.


因为css使用了浮动,使得调整浏览器大小的时候,里面的div可以跟着适应大小的变化