How can I make the main contents of a web page use the full width on a mobile device whilst using just a portion (say 60% of the width, centred) on a desktop?
This is what I have tried so far, HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
...
<body>
...
<div id="container">
<!-- Content goes here! -->
</div>
...
</body>
</html>
CSS:
#container
{
display: inline-block;
width: 60%;
margin-left: 20%;
margin-right: 20%;
}