I'm a beginner programmer I'm working on a website with my friend Alex, we're both beginners actually, I took on the task of designing the landing page to get some practice in. I want to have these divs which contain nothing but text centered horizontally and vertically (or dead center), I've tried some things other people have suggested on other posts on this site but nothing seems to be working. Could one of you gurus please help me? And thanks in advance :D (I should probably mention that I'm using DW with the Bootstrap framework)
Here's the html:
<!DOCTYPE html>
<html lang="en">
<head>
<!--GOOGLE FONT-->
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Untitled Document</title>
<!-- Bootstrap -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/stylesheet.css" rel="stylesheet" type="text/css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="background">
<div id="nav">
<ul>
<li><a href=""> About </a></li>
<li><a href=""> Sign up </a></li>
</ul>
</div>
<div id="welcome">
<p>TEXT I WANT CENTERED</p>
</div>
<div id="best">
TEXT I WANT BELOW CENTERED TEXT
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery-1.11.2.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.js"></script>
</body>
</html>
Heres the css:
@charset "utf-8";
/* CSS Document */
.background {
background: url(../img/bg1.jpg) no-repeat 50% 50% fixed;
margin: 0 auto;
max-width: 80%;
min-width: 50%;
width: 80%;
height:auto;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
-moz-background-size: cover;
}
li {
display: inline;
letter-spacing: 2px;
padding-right: 0.5em;
float: right;
font-size: 125%;
font-style:normal;
font-weight: bold;
text-transform: uppercase;
text-decoration:none;
color:#ffffff;
text-shadow: 4px 3px 0px #000000, 9px 8px 0px rgba(0,0,0,0.15);
}
#welcome {
font-family: 'Montserrat', sans-serif;
max-width: 90%;
min-width: 80%;
height: 50%;
font-size: 350%;
font-style:normal;
font-weight: bold;
text-transform:uppercase;
text-decoration:none;
text-align: center;
color:#ffffff;
position: relative;
text-shadow: 4px 3px 0px #000000, 9px 8px 0px rgba(0,0,0,0.15);
z-index: 9998;
}
welcome p {
width: 300px;
height: 100px;
padding: 20px;
}
#best {
font-family: 'Montserrat', sans-serif;
max-width: 100%;
min-width: 70%;
font-size: 200%;
font-style:normal;
font-weight: bold;
text-transform:uppercase;
text-decoration:none;
text-align:center;
color:#ffffff;
position: relative;
text-shadow: 4px 3px 0px #000000, 9px 8px 0px rgba(0,0,0,0.15);
}
p {
text-align:center;
}
a {
color: #FFFFFF;
}
a {
hover: #2a7315;
text-decoration: none;
}