Citat:
Ursprungligen postat av
Flach1337
Det jag menade var att besökarna kan själva ändra storleken på den. Höja eller sänka den exakt som de vill.
Responsive
Med responsive kan man låta användarna styra divarnas storlek genom att ändra fönsterstorleken.
Se länk ovan eller detta ofullständiga, mycket enkla exempel:
html:
HTML-kod:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="initial-scale=2.0,width=device-width" />
<title>And the winner isn't</title>
<link href="./main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<!-- the header and navigation -->
<div id="header">Header
<div id="navigation">
<ul>
<li><a href="#">navigation1</a></li>
<li><a href="#">navigation2</a></li>
</ul>
</div>
</div>
<div id="content">
<p><b>Here is the content.</b><br>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
<!-- the footer -->
<div id="footer">
<p>Here is the footer</p>
</div>
</div>
</body>
</html>
main.css:
HTML-kod:
html, body {
width: 100%;
height: 100%;
background: #ffe0e0;
}
body > #wrapper {
width: 95%;
height: 95%;
background: #e0ffe0;
}
body > #wrapper > #header {
height: 4m;
color: #ff0000; background: #e0e0ff;
}
body > #wrapper > #header > #navigation {color: #00ff00; background: #c0c0ff;}
body > #wrapper > #content {
width: 90%;
height: 80%;
background: #ffffe0;
}
HTML5/JS
Med html5/js kan man låta användaren styra elements plats och storlek inom fönstret.
Här finns exempel:
http://interactjs.io
Scrolla ner till "Dragging" och "Resizing".
–