Su página web debe verse bien y ser fácil de usar independientemente del dispositivo. ¿Cuál es el truco de diseño?
El diseño web sensitivo hace que su página web se ve bien en todos los dispositivos (equipos de escritorio, tabletas y móviles).
El diseño web es sobre el uso de CSS y HTML para cambiar el tamaño, apariencia, reducir, ampliar, o mover el contenido para que se vea bien en cualquier pantalla:
<!DOCTYPE html>
<html lang="en-us">
<head>
<style>
.city {
float: left;
margin: 10px;
padding: 10px;
width: 300px;
height: 300px;
border: 1px solid black;
}
</style>
</head>
<body>
<h1>Responsive Web Design Demo</h1>
<h2>Resize this responsive page!</h2>
<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>
<div class="city">
<h2>View Source</h2>
<p>View the source code to see how this page was built.</p>
</div>
</body>
</html>
--------------------------------------------------------
Segunda forma - Usando CSS3
Otra forma de crear un diseño de respuesta, es utilizar una hoja de estilos de respuesta, al igual que .CSS3
CSS3 hace que sea fácil de desarrollar sitios que se ven bien en cualquier tamaño; escritorio, portátil, tableta o teléfono:
<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<body>
<div class="w3-container w3-orange">
<h1>W3.CSS Demo</h1>
<p>Resize this responsive page!</p>
</div>
<div class="w3-row-padding">
<div class="w3-third">
<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="w3-third">
<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="w3-third">
<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>
</div>
</body>
</html>
Responsive web design makes your web page look good on all devices.
Responsive web design uses only HTML and CSS.
Responsive web design is not a program or a JavaScript.
Desktop Tablet Phone
Se llama diseño web sensible cuando se utiliza CSS y HTML para cambiar el tamaño, piel, reducir, ampliar, o mover el contenido para que se vea bien en cualquier pantalla.
CSS responsive
http://www.w3schools.com/w3css/w3css_responsive.asp
W3.CSS includes a responsive, mobile first grid system to handle your layout:
W3.CSS's grid system is responsive, and the columns will re-arrange automatically depending on the screen size:
1/2
1/4
3/4
1/4
1/2
1/4
1/4
1/4
1/3
1/2
1/3
50px
rest
1/4
1/4
1/4
rest
1/2
1/4
1/2
1/4
100px
rest
45px
Responsive classes must be placed inside a w3-row to be fully responsive.
Class
w3-row
w3-row-padding
Description
Defines a padding-less container for responsive classes.
Defines a padded container for responsive classes.
The width of the w3-half class is 1/2 of the parent element (style="width:50%").
On small* screens it resizes to 100%.
<div class="w3-row">
<div class="w3-green w3-container w3-half">
<h2>w3-half</h2>
</div>
<div class="w3-container w3-half">
<h2>w3-half</h2>
</div>
</div>
The width of the w3-third class is 1/3 of the parent element (style="width:33.33%").
On small* screens it resizes to 100%.
<div class="w3-row">
<div class="w3-green w3-container w3-third">
<h2>w3-third</h2>
</div>
<div class="w3-container w3-third">
<h2>w3-third</h2>
</div>
<div class="w3-container w3-third">
<h2>w3-third</h2>
</div>
</div>
The width of the w3-twothird class is 2/3 of the parent element (style="width:66.66%").
On small* screens it resizes to 100%.
<div class="w3-row">
<div class="w3-green w3-container w3-twothird">
<h2>w3-twothird</h2>
</div>
<div class="w3-container w3-third">
<h2>w3-third</h2>
</div>
</div>
The width of the w3-quarter class is 1/4 of the parent element (style="width:25%").
On small* screens it resizes to 100%.
<div class="w3-row">
<div class="w3-green w3-container w3-quarter">
<h2>w3-quarter</h2>
</div>
<div class="w3-container w3-quarter">
<h2>w3-quarter</h2>
</div>
<div class="w3-container w3-quarter">
<h2>w3-quarter</h2>
</div>
<div class="w3-container w3-quarter">
<h2>w3-quarter</h2>
</div>
</div>
The width of the w3-threequarter class is 3/4 of the parent element (style="width:75%").
On small* screens it resizes to 100%.
<div class="w3-row">
<div class="w3-green w3-container w3-threequarter">
<h2>w3-threequarter</h2>
</div>
<div class="w3-container w3-quarter">
<h2>w3-quarter</h2>
</div>
</div>
<div class="w3-row">
<div class="w3-half w3-container">
<h2>w3-half</h2>
<div class="w3-row">
<div class="w3-half w3-container w3-red">
<h2>w3-half</h2>
<p>This is a paragraph.</p>
</div>
<div class="w3-half w3-container">
<h2>w3-half</h2>
<p>This is a paragraph.</p>
</div>
</div>
</div>
<div class="w3-half w3-container">
<h2>w3-half</h2>
<div class="w3-row">
<div class="w3-half w3-container w3-red">
<h2>w3-half</h2>
<p>This is a paragraph.</p>
</div>
<div class="w3-half w3-container">
<h2>w3-half</h2>
<p>This is a paragraph.</p>
</div>
</div>
</div>
</div>
The w3-rest class will use what's left of the grid column.
<div class="w3-row">
<div class="w3-col" style="width:150px"><p>150px</p></div>
<div class="w3-rest w3-green"><p>rest</p></div>
</div>
You can also use the CSS width property to determine a specific width of the columns.
<div class="w3-row">
<div class="w3-col" style="width:20%"><p>20%</p></div>
<div class="w3-col" style="width:60%"><p>60%</p></div>
<div class="w3-col" style="width:20%"><p>20%</p></div>
</div>
The w3-content class defines a container for fixed size centered content. Use the CSS max-width property to override the default width (980px).
<body class="w3-content" style="max-width:500px">
page content...
</body>
The w3-row class defines a padded-less container, while the w3-row-padding class adds a 8px left and right padding to each column:
w3-row:
w3-row-padding:
<div class="w3-row">
<div class="w3-col s4"><img src="img_lights.jpg"></div>
<div class="w3-col s4"><img src="img_nature.jpg"></div>
<div class="w3-col s4"><img src="img_fjords.jpg"></div>
</div>
<div class="w3-row-padding">
<div class="w3-col s4"><img src="img_lights.jpg"></div>
<div class="w3-col s4"><img src="img_nature.jpg"></div>
<div class="w3-col s4"><img src="img_fjords.jpg"></div>
</div>
W3.CSS also supports an advanced 12 column responsive fluid grid.
I am 150px
20%
I am the rest
60%
20%