I've read through tons of stackoverflow looking for an answer to this question. Everyone says use float: left
, float:right
, overflow: hidden
, display: block
, etc. but none of it is working for me. I'm thinking it has something to do with my margins, but I've been playing around with it and can't find an answer.
I want my Welcome message to display to the left of my two divs. I'm basically trying to copy the twitter homepage (www.twitter.com).
Fiddle: http://jsfiddle.net/CuwA6/
HTML:
<body>
<div id="content">
<div id="welcome">
<h1>Welcome!</h1>
<h2>Blah blah blah...</h2>
</div>
<div id="login">
<form>
<h3>Please Sign In</h3>
<input type="text" name="email" placeholder="Username or Email" /><br/>
<input type="text" name="password" placeholder="Password" /><br/>
<input type="submit" value="Sign In" />
</form>
</div>
<div id="signup">
<form>
<h3>Sign up</h3>
<input type="text" name="name" placeholder="Full Name" /><br/>
<input type="text" name="email" placeholder="Email" /><br/>
<input type="text" name="password" placeholder="Password" /><br/>
<input type="submit" value="Sign Up" />
</form>
</div>
</div>
<div id="bird">
<img alt="" src="img/Bird.png" />
</div>
CSS:
body {
background: url(img/picture2.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#welcome {
margin: 0 30%;
text-align: center;
vertical-align: middle;
}
#login,
#signup {
margin: 10px 50%;
background-color: #F0F0F0;
padding: 0px 25px 25px 15px;
border: 1px solid;
border-radius: 15px;
width: 300px;
letter-spacing: 1px;
position: relative;
z-index: 1;
}
#bird {
z-index: 0;
position: fixed;
bottom: 0px;
left: 0px;
}
input {
margin: 3px 0px;
padding: 5px;
width: 100%;
}