首页 > 其他分享 >HTML响应式Web设计

HTML响应式Web设计

时间:2022-12-14 01:23:06浏览次数:69  
标签:Web most city Tokyo 响应 HTML capital populous

什么是响应式 Web 设计?

  • RWD 指的是响应式 Web 设计(Responsive Web Design)
  • RWD 能够以可变尺寸传递网页
  • RWD 对于平板和移动设备是必需的

主要是在CSS里面定义float等字段

创建您自己的响应式设计

创建响应式设计的一个方法,是自己来创建它:

<!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>W3School Demo</h1>
<h2>Resize this responsive page!</h2>
<br>

<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 and most populous city of France.</p>
</div>

<div class="city">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area,
and the most populous metropolitan area in the world.</p>
</div>

</body>
</html>

使用 Bootstrap

另一个创建响应式设计的方法,是使用现成的 CSS 框架。

Bootstrap 是最流行的开发响应式 web 的 HTML, CSS, 和 JS 框架。

Bootstrap 帮助您开发在任何尺寸都外观出众的站点:显示器、笔记本电脑、平板电脑或手机:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" 
  href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>

<body>

<div class="container">
<div class="jumbotron">
  <h1>W3School Demo</h1> 
  <p>Resize this responsive page!</p> 
</div>
</div>

<div class="container">
<div class="row">
  <div class="col-md-4">
    <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="col-md-4">
    <h2>Paris</h2>
    <p>Paris is the capital and most populous city of France.</p>
  </div>
  <div class="col-md-4">
    <h2>Tokyo</h2>
    <p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area,
    and the most populous metropolitan area in the world.</p>
  </div>
</div>
</div>

</body>
</html>

 

Bootstrap 教程

标签:Web,most,city,Tokyo,响应,HTML,capital,populous
From: https://www.cnblogs.com/JohnsonQ/p/16981060.html

相关文章

  • HTML字符实体
    HTML中的预留字符必须被替换为字符实体。HTML实体在HTML中,某些字符是预留的。在HTML中不能使用小于号(<)和大于号(>),这是因为浏览器会误认为它们是标签。如果希望正......
  • HTML 编码(字符集)
    为了正确显示HTML页面,Web浏览器必须知道要使用哪个字符集。从ASCII到UTF-8ASCII是第一个字符编码标准。ASCII定义了128种可以在互联网上使用的字符:数字(0-9)、英......
  • webpack——webpackMerge is not a function
    前言引入导致,因为webpackMerge的却不是一个函数呀~内容?>正确示范constwebpackMerge=require('webpack-merge')module.exports=webpackMerge.merge(webpackBas......
  • HttpWebRequest获取url出现:基础连接已经关闭:超出了消息长度限制
    在使用HttpWebRequest获取远程url的时候,出现了莫名其妙的一个错误,找遍了所有渠道,网上都没有相关案例,最后经过自己仔细琢磨,终于研究出来了解决案例,案例如下 出现的问题:......
  • springMVC06(1-响应,2-类返回成JSON数据)
    一、大纲二、响应JSON数据(把你给的"类"转化成"JSON"数据)2.1:需要有"@ResponseBody"这个注解2.2:需要导入JSON坐标<dependency><groupId>com.fasterxml.......
  • 使用 WebAPI获取实体的复数名称
    Xrm.Utility.getEntityMetadata("opportunity","").then(function(result){console.log("当前实体的复数名称:"+result.EntitySetName);},functio......
  • webapi excel导入
     效果图  引入命名空间:usingNPOI;usingNPOI.HSSF.UserModel;usingNPOI.SS.UserModel;usingNPOI.XSSF;usingNPOI.XSSF.UserModel;usingXiaowu_Ship.Model;//......
  • html学习笔记五 安利网页案例
    将整个页面分为header、nav、banner、list、footer五大部分,下图1~3为网页的html结构部分,图4~7为网页的CSS样式表部分,图8和图9为网页实际效果......
  • Flask请求与响应
    请求与响应#请求对象requestdefindex():print(request.method)#请求方式print(request.form)#post请求数据print(request.args)#get请求数......
  • Java 使用 wkhtmltopdf 生成 PDF 遇到的几个坑
    wkhtmltopdf使用本地文件生成PDF一般使用命令wkhtmltopdfURLpdfPath生成PDF文件,其中URL为GET请求地址。但是笔者在做的项目是一个模板中心服务(后续代码整理......