HTML Responsive Web Page
2017-07-12 08:27
190 查看
注:参考网站 https://www.w3schools.com
显示结果为:
HTML Responsive Web Page
index.html
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> <title>Responsive web page</title> <meta lang="en" charset="utf-8"> </head> <body> <h1>Responsive Web Design</h1> <div class="city"> <h2>London</h2> <p>London is the capital city of England.</p> <p>It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p> </div> <div class="city"> <h2>Paris</h2> <p>Paris is the capital of France.</p> <p>The Paris area is one of the largest population centers in Europe, with more than 12 million inhabitants.</p> </div> <div class="city"> <h2>Tokyo</h2> <p>Tokyo is the capital of Japan.</p> <p>It is the center of the Greater Tokyo Area, and the most populous metropolitan area in the world.</p> </div> </body> </html>
style.css
h1 { text-align:center; background-color:black; padding:5px; color:white; } .city { height:200px; max-width:410px; border:1px solid grey; margin:10px; padding:5px; overflow:hidden; float:left; /*关键是这一行代码,使得该代码能够在不同的设备上自适应的显示*/ }
显示结果为:
相关文章推荐
- 如何用.Net 取得指定网面的内容? How to get html web page data?
- [Codecademy] HTML&CSS 第二课:Build Your Own Webpage
- How to save a web page as HTML or MHT
- How to get the HTML source of a webpage in Ruby
- [Codecademy] HTML&CSS 第二课:Build Your Own Webpage
- html2canvas- Take Screenshot of Web Page and Save It to Server (Javascript and PHP)
- SilverLight_How to: Add Silverlight to a Web Page by Using HTML
- Web page construct -- Head first into HTML
- HTML Iframes & Responsive Web Design
- HTML Editor and Web Page Editor Choices
- 自适应网页设计(Responsive Web Design)--转载自http://www.ruanyifeng.com/blog/2012/05/responsive_web_design.html
- HTML CSS:Web Page Construction
- Generate PDF documents from a HTML page using ASP.NET
- ASP.Net Web Page深入探讨
- EMule Developers page Web Site
- [ZT]Submitting Web Form data from one ASP.NET page to another
- How to freeze a dynamic aspx page into a static html page (on the server).
- How to deploy a .Net assmebly for COM use through CAB on Web Page (转)
- Show how to print a table in a html page
- How to grab web page in chinese