To center your layout horizontally and vertically while keeping everything else the same, you need to adjust the CSS for the body and #wrap elements. Here's the updated code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Startpage</title>
<link href='http://fonts.googleapis.com/css?family=Monda' rel='stylesheet' type='text/css' />
<style type="text/css">
<!--
body {
background: #0d151d url(http://i.imgur.com/OU6WhIS.png) center;
list-style-image: none;
text-transform: lowercase;
height: 100vh; /* Make sure the body is the full height of the viewport */
display: flex; /* Use flexbox for centering */
align-items: center; /* Vertically align children */
justify-content: center; /* Horizontally align children */
margin: 0; /* Remove default body margin */
}
#wrap {
width: 400px;
}
#label {
font-family: Monda, verdana;
font-size: 8px;
font-weight: 800;
color: #9f440d;
padding-left: 14px;
text-align: left;
text-shadow: 1px 1px 0 rgba(12,18,25,0.4);
}
#links {
width: 100px;
}
#links ul {
margin: 0;
padding: 0;
list-style-type: none;
font-family: Monda, verdana;
font-size: 10px;
font-weight: 400;
line-height: 12px;
}
#links ul li {
margin: 0;
padding: 0;
}
#links a {
display: block;
padding: 2px 10px 2px 10px;
margin: 0 0 1px;
background-color: #101a23;
border-left: 2px solid #131F2A;
text-shadow: #0D1720 1px 1px 0;
box-shadow: 1px 1px 1px 0px rgba(12,18,25,0.4);
text-align: left;
}
html>body #links a {
width: 100px;
}
#links a:link,#links a:visited {
color: #566470;
text-decoration: none;
}
#links a:hover {
background-color: #9f440d;
color: #c4c4c4;
border-left: 2px solid #C45310;
text-shadow: #8C3C0C 1px 1px 0;
}
input,select,textarea {
font-family: Monda, verdana;
font-size: 10px;
font-weight: 400;
border: 1px solid;
border-color: #111d26;
background: #0C141C;
color: #566470;
padding: 1px 4px 1px 4px;
border-radius: 2px;
box-shadow: 1px 1px 1px 0px rgba(12,18,25,0.4);
}
a {
outline: 0;
}
a: hover, a: active, a: focus {
outline: none;
}
input::-moz-focus-inner {
border: 0;
}
#button {
background-color: #101a23;
border: none;
border-radius: 2px;
text-shadow: #0D1720 1px 1px 0;
box-shadow: 1px 1px 1px 0px rgba(12,18,25,0.4);
font-family: Monda, verdana;
font-size: 10px;
font-weight: 400;
padding: 2px 6px 2px 6px;
}
#button:hover,#button.hover {
background-color: #9f440d;
color: #ABADB0;
text-shadow: #8C3C0C 1px 1px 0;
}
#button:active,#button.active {
background-color: #9f440d;
box-shadow: 1px 1px 1px 0px rgba(12,18,25,0.4);
transform: translateY(1px);
text-shadow: #8C3C0C 1px 1px 0;
}
/* SECTIONS */
.section {
clear: both;
padding: 0px;
margin: 0px;
}
.col {
display: block;
float: left;
margin: 0;
}
.col:first-child { margin-left: 0; }
.group:before,
.group:after { content:""; display:table; }
.group:after { clear:both;}
.group { zoom:1; /* For IE 6/7 */ }
.span_3_of_3 { width: 100%; }
.span_2_of_3 { width: 66.13%; }
.span_1_of_3 { width: 32.26%; }
@media only screen and (max-width: 480px) {
.col { margin: 1% 0 1% 0%; }
.span_3_of_3, .span_2_of_3, .span_1_of_3 { width: 100%; }
}
-->
</style>
</head><body>
<div id="wrap">
<div class="section group">
<div class="col span_1_of_3">
<div id="label">001</div>
<div id="links">
<ul>
<li><a href="http://deviantart.com/">deviantart</a></li>
<li><a href="http://alpha.wallhaven.cc">wallhaven</a></li>
<li><a href="http://pandora.com">pandora</a></li>
<li><a href="http://soundcloud.com">soundcloud</a></li>
</ul>
</div>
</div>
<div class="col span_1_of_3">
<div id="label">002</div>
<div id="links">
<ul>
<li><a href="http://github.com">github</a></li>
<li><a href="http://dotshare.it">dotshare</a></li>
<li><a href="http://gmail.com">gmail</a></li>
<li><a href="http://youtube.com">youtube</a></li>
</ul>
</div>
</div>
<div class="col span_1_of_3">
<div id="label">003</div>
<div id="links">
<ul>
<li><a href="http://imgur.com">imgur</a></li>
<li><a href="http://reddit.com">reddit</a></li>
<li><a href="http://webupd8.org">web upd8</a></li>
<li><a href="http://gamingonlinux.com">gamingonlinux</a></li>
</ul>
</div>
</div>
</div>
<div align="center" style="margin-top: 10px;">
<form method="get" action="http://www.google.com/search">
<input type="text" name="q" size="22" />
<input type="submit" value="search" id="button" />
</form>
</div>
</div>
</body></html>
Key Changes:
body:
height: 100vh; ensures the body spans the full viewport height.
display: flex; enables flexbox for centering the contents of the body.
align-items: center; vertically aligns the content.
justify-content: center; horizontally aligns the content.
- Removed default margins with
margin: 0.
This ensures your layout is perfectly centered both horizontally and vertically. The rest of the layout and styles remain unchanged.