Maybe it's too late at night.. I'm not sure, but I can't figure out why the bottom of my body is cut off. I've tried playing around with margins/padding, but nothing is working the way it should.
I originally used an ID on my body element, but then decided to add an extra DIV and that's when it broke.
It gets cut off at 601px, which makes me think my margins are off, but I can't tell. I'd like the <div ID='index'> to fill the entire page, but it's not.
Live Example: http://jsfiddle.net/QbUKN/1/
CSS:
body {
margin: 0;
padding: 0;
}
#index {
background: url(../img/bamboo.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-color:#b0c4de;
/*
position: absolute;
width: 100%;
height: 100%;
z-index:-1; */
}
#profile {
background: url(../img/lime.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#bird {
z-index: 0;
position: fixed;
bottom: 0;
left: 0;
}
/******** WELCOME PAGE ********/
#indexContent {
padding-top: 150px;
}
#welcome {
margin-left: 15%;
margin-top: 150px;
text-align: center;
vertical-align: middle;
float:left;
width: 40%;
z-index: 1;
}
#welcome h1, h2 {
color: white;
font-family: 'Poller One', cursive;
}
#login, #signup {
margin: 10px 60%;
background-color: #FCFAEE;
padding: 0 25px 20px 15px;
border:1px solid;
border-radius: 15px;
width: 300px;
position: relative;
z-index: 1;
/*Box shadow to make div look like it is popping off screen
-webkit-box-shadow: 0px 0px 30px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 30px rgba(0,0,0,0.75);
box-shadow: 0px 0px 30px rgba(0,0,0,0.75); */
}
#login h3, #signup h3 {
border-bottom: 1px solid;
padding-bottom: 10px;
border-color: #D8D8D8;
margin-bottom: 10px;
}
#login .button, #signup .button {
width: 104%;
}
.textField{
margin: 3px 0px;
padding: 5px;
width: 100%;
}
/******** PROFILE ********/
.fillPage {
height: 100%;
margin: 0;
padding: 0;
}
#profileContent {
/*background-color: rgba(255,255,255, .50);*/
background-repeat:repeat;
min-height: 100%;
margin: 0 20% 0 20%;
overflow: hidden; /* Removes background-color gap at end of page in IE */
min-width: 600px;
}
#username {
float: left;
line-height: 1.5em;
}
#logout {
float: right;
margin-right: 25px;
}
#left {
width: 250px;
float: left;
position: fixed;
}
#right{
margin-left: 290px;
margin-right: 50px;
}
#left, #right {
padding-top: 70px;
}
.clear{
clear: both;
}
#stickyNav {
position: fixed;
font-size: 1.5em;
color: white;
background: black;
z-index: 1000;
min-width: 100%;
padding: 10px;
}
.menuItem {
margin: 0px 10px 10px 10px;
background-color: #FCFAEE;
padding: 10px;
border:1px solid;
border-radius: 15px;
width: 100%;
position: relative;
z-index: 1;
-webkit-box-shadow: 2px 2px 0px black;
-moz-box-shadow: 2px 2px 0px black;
box-shadow: 2px 2px 0px black;
}
textarea {
width: 100%;
margin-bottom: 5px;
vertical-align: top;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
overflow: auto;
}
/******** Button Effects ********/
.button {
width: 100%;
-moz-box-shadow:inset 0px 1px 0px 0px #ffe0b5;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffe0b5;
box-shadow:inset 0px 1px 0px 0px #ffe0b5;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #fbb450), color-stop(1, #f89306));
background:-moz-linear-gradient(top, #fbb450 5%, #f89306 100%);
background:-webkit-linear-gradient(top, #fbb450 5%, #f89306 100%);
background:-o-linear-gradient(top, #fbb450 5%, #f89306 100%);
background:-ms-linear-gradient(top, #fbb450 5%, #f89306 100%);
background:linear-gradient(to bottom, #fbb450 5%, #f89306 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89306',GradientType=0);
background-color:#fbb450;
-moz-border-radius:7px;
-webkit-border-radius:7px;
border-radius:7px;
border:1px solid #c97e1c;
display:inline-block;
color:#ffffff;
font-family:Trebuchet MS;
font-size:17px;
font-weight:normal;
padding:6px 11px;
text-decoration:none;
text-shadow:0px 1px 0px #8f7f24;
}
.button:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f89306), color-stop(1, #fbb450));
background:-moz-linear-gradient(top, #f89306 5%, #fbb450 100%);
background:-webkit-linear-gradient(top, #f89306 5%, #fbb450 100%);
background:-o-linear-gradient(top, #f89306 5%, #fbb450 100%);
background:-ms-linear-gradient(top, #f89306 5%, #fbb450 100%);
background:linear-gradient(to bottom, #f89306 5%, #fbb450 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f89306', endColorstr='#fbb450',GradientType=0);
background-color:#f89306;
}
.button:active {
position:relative;
top:1px;
}
HTML:
<div id="index">
<div id="indexContent">
<div id="welcome">
<h1>Welcome!</h1>
<h2>MORE STUFF</h2>
</div>
<div id="login">
<form name="login" action="users/profile" method="post">
<h3>Please Sign In</h3>
<input class="textField" type="text" name="email" placeholder="Username or Email"/><br/>
<input class="textField" type="text" name="password" placeholder="Password"/><br/>
<input class="button" type="submit" value="Sign In"/>
</form>
</div>
<div id="signup">
<form>
<h3>Sign up</h3>
<input class="textField" type="text" name="name" placeholder="Full Name"/><br/>
<input class="textField" type="text" name="email" placeholder="Email"/><br/>
<input class="textField" type="text" name="password" placeholder="Password"/><br/>
<input class="button" type="submit" value="Sign Up" />
</form>
</div>
</div>
<div id="bird">
<img src="img/parrot.png" alt="Parrot" />
</div>
</div>
If you want your background to fill the entire page, you should leave your background styles on body. In your index div, you only have 601px of content in height, that's why your background cuts off at 601px.
Edit: this might be what you want.
html {
height: 100%;
}
body {
height: 100%;
}
#index {
height: 100%;
}
fiddle
Adding bottom padding to your existing #indexContent would be the simplest solution.
#indexContent {
padding-top: 150px;
padding-bottom: 150px;
}
#indexContent {
padding-bottom: 100px;
padding-top: 150px;
}
#bird {
bottom: 0;
height: 100px;
left: 0;
position: fixed;
z-index: 0;
}
'#indexContent' div's padding-bottom should be equal or higher than '#bird' div height
Your code works perfectly fine. Just add a small change on id 'index' and 'bird'.
#index {
Display : table;
background: url(../img/bamboo.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-color:#b0c4de;
width:100%;
height:100%;
position: relative;
}
#bird {
position:fixed;
bottom: 0;
left: 0;
}
Related
I'm trying to do this
The main idea is to make the carousel inside this div which will contain images and text.
.background {
height: 657px;
/* background-color: red; */
background-image: linear-gradient(135deg, #D4B8CE 5%, #DEC2D8 100%);
}
.background:before {
content: '';
width: 100%;
height: .3%;
bottom: 20%;
position: absolute;
background-image: linear-gradient(to right, #B59AB0 5%, #CBB2C7 100%);
}
.background:after {
z-index: 9;
content: '';
background-image: linear-gradient(45deg, #D9BDD4 5%, #EBCFE5 100%);
width: 100%;
height: 20%;
position: absolute;
bottom: 0;
}
.listdiv {
z-index: 10;
position: absolute;
height: 80%;
bottom: 12%;
left: 40%;
width: 25%;
background-color: white;
background-image: url(https://i.pinimg.com/originals/93/34/c7/9334c7e1fb00a2b49b8c1d4504ec0a45.jpg);
background-size: contain;
background-position: center;
background-repeat: no-repeat;
box-shadow: 0px 6px 12px -6px #00000066;
}
.listdiv::before {
content: '';
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-width: 404.8px 50px 44px 0;
border-color: transparent #9191913d transparent transparent;
line-height: 0px;
left: -15.5%;
filter: saturate(52);
filter: drop-shadow(-5px 4px 17px black)blur(8px);
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="background w-100 bg-red">
<div class="listdiv">
</div>
</div>
How I can realize this shadow like the above image?
Please run code snippet in full page mode to see the issue.
You can approximate this using pseudo element, gradient and some filter.
Play with the different values until you get what you want:
body {
background:pink;
margin:0;
padding-bottom:100px;
}
.container {
padding:20px;
background:#e4a8b3;
position:relative;
z-index:-1;
}
.box {
background:white;
width:200px;
height:300px;
margin:0 auto -50px;
border:1px solid grey;
position:relative;
}
/* Relevant code start here */
.box:before,
.box:after {
content:"";
position:absolute;
z-index:-1;
right:98%;
width:70px;
filter:blur(4px);
}
.box:before {
bottom:30px;
top:0;
background:
linear-gradient(to bottom right,transparent 45%,rgba(0, 0, 0, 0.4) 70%)
bottom / 100% 115%;
}
.box:after {
height:32px;
bottom:0;
background:
linear-gradient(to top right,transparent 45%,rgba(0, 0, 0, 0.4) 70%)
top / 100% 115%;
}
/**/
<div class="container">
<div class="box"></div>
</div>
You can optimize the code to use only one pseudo element:
body {
background:pink;
margin:0;
padding-bottom:100px;
}
.container {
padding:20px;
background:#e4a8b3;
position:relative;
z-index:-1;
}
.box {
background:white;
width:200px;
height:300px;
margin:0 auto -50px;
border:1px solid grey;
position:relative;
}
/* Relevant code start here */
.box:before {
content:"";
position:absolute;
z-index:-1;
right:98%;
width:70px;
top:0;
bottom:0;
filter:blur(4px);
background:
linear-gradient(to top right,transparent 45%,rgba(0, 0, 0, 0.4) 70%)
bottom -10px center / 100% calc(30px + 10px),
linear-gradient(to bottom right,transparent 45%,rgba(0, 0, 0, 0.4) 70%)
top -20px center / 100% calc(100% - 30px + 20px);
background-repeat:no-repeat;
}
/**/
<div class="container">
<div class="box"></div>
</div>
In my chat, I would like to have a text message displayed in the balloon for one button and an image from my gallery for the other button. The programming for the text works. How do I get this with the picture?
My HTML Code is this one:
<!DOCTYPE html>
<link rel="stylesheet" href="style.css">
<div class="Webview">
<div class="message_container" id="myForm" >
<div class="Chat_Bubble"></div>
</div>
<form class="send_container">
<input id="textField" type="text">
<img id="Bildverschicken" src="baseline_image_black_18dp.png">
<p>
<input type ="button" id="theButton" value="Nachricht absenden!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].textContent=document.getElementById('textField').value"/>
</p>
<input type="button" id="Button_Bilder" value="Bild verschicken!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].imageContent=document.getElementById('Bildverschicken').value"/>
<h3><div id="div"></div></h3>
</form>
</div>
Can someone help me? Thanks!
#charset "UTF-8";
.Webview{
height: 600px;
width: 380px;
}
.message_container{
height: 80%;
width: 100%;
border:5px solid green;
}
.Chat_Bubble{
box-sizing: border-box;
float: left;
width: auto;
max-width: 80%;
position: relative;
clear: both;
background: #95c2fd;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.15, #bee2ff), color-stop(1, #95c2fd));
background-image: -webkit-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -moz-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -ms-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -o-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
border: solid 1px rgba(0,0,0,0.5);
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
-moz-box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
margin-bottom: 20px;
padding: 6px 20px;
color: #000;
text-shadow: 0 1px 1px rgba(255,255,255,0.8);
word-wrap: break-word;
}
.bubble:before, .bubble:after {
border-radius: 20px / 5px;
content: '';
display: block;
position: absolute;
}
.bubble:before {
border: 10px solid transparent;
border-bottom-color: rgba(0,0,0,0.5);
bottom: 0px;
left: -7px;
z-index: -2;
}
.bubble:after {
border: 8px solid transparent;
border-bottom-color: #bee2ff; /* arrow color */
bottom: 1px;
left: -5px;
}
.bubble-alt {
float: right;
}
.bubble-alt:before {
left: auto;
right: -7px;
}
.bubble-alt:after {
left: auto;
right: -5px;
}
.bubble p {
font-size: 1.4em;
}
}
.send_container{
height: 20;
width: 100%;
}
.send_container input{
width: 70%;
height:20%
border:2px solid #1CE615;
}
.send_container button{
width: 30%;
height:20%;
}
.send_container Button_Bilder{
width: 10%;
height:10% ;
}
<!DOCTYPE html>
<link rel="stylesheet" href="style.css">
<div class="Webview">
<div class="message_container" id="myForm" >
<div class="Chat_Bubble"></div>
</div>
<form class="send_container">
<input id="textField" type="text">
<img id="Bildverschicken" src="baseline_image_black_18dp.png">
<p>
<input type ="button" id="theButton" value="Nachricht absenden!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].textContent=document.getElementById('textField').value"/>
</p>
<input type="button" id="Button_Bilder" value="Bild verschicken!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].imageContent=document.getElementById('Bildverschicken').value"/>
<h3><div id="div"></div></h3>
</form>
</div>
Is it possible to add a blur to only one side of a div using box-shadow?
What I am trying to achieve is a shadow with no width, just blur on only one side of a div. In my example I try to apply it to the bottom but the side really shouldn't matter.
I tried have using box-shadow: 0px 5px 5px -5px #000000; however using this method the shadow does not cover the whole length on the bottom of the div.
#bg {
text-align: center;
width: 200px;
height: 200px;
padding: 50px;
background: #eeeeee;
}
#box {
width: 100%;
height: 100%;
box-shadow: 0px 5px 5px -5px #000000;
background: yellow;
}
<div id="bg">
<div id="box"></div>
</div>
Only HTML and CSS solutions please.
You could use an after element and stretch it a little:
#bg {
text-align: center;
width: 200px;
height: 200px;
padding: 50px;
background: #eeeeee;
}
#box:after {
content:'';
display:block;
position:absolute;
z-index:0;
top:0;
left:-4px;
right:-4px;
bottom:0;
box-shadow: 0px 5px 5px -5px #000000;
}
#box {
width: 100%;
height: 100%;
position:relative;
background: yellow;
}
<div id="bg">
<div id="box"></div>
</div>
try this for bottom positioned box-shadow
.your_class {
box-shadow: 0 8px 6px -6px black;
}
You can also read https://developer.mozilla.org/en/docs/Web/CSS/box-shadow to understand how the box-shadow works
#bg {
text-align: center;
width: 200px;
height: 200px;
padding: 50px;
background: #eeeeee;
}
#box {
width: 100%;
height: 100%;
border-bottom: 2px solid #ccc;
background: yellow;
}
<div id="bg">
<div id="box"></div>
</div>
There is no readily available way to do precisely what you seek, at least not using a single box-shadow. Remember, the CSS box-shadow property accepts multiple comma-delimited entries, so this is your best bet if you're committed to using them. In the example below, I'm simply using two copies of the same box-shadow value with one difference: I've offset the first horizontally toward the left by 2.5px and the other toward the right by positive 2.5px. Additionally, I've added opacity to the color (due to mitigate the darkening effect of overlapping shadows).
#bg {
text-align: center;
width: 200px;
height: 200px;
padding: 50px;
background: #EEE;
}
#box {
width: 100%;
height: 100%;
box-shadow: -2.5px 5px 5px -3px rgba(0, 0, 0, 0.50),
2.5px 5px 5px -3px rgba(0, 0, 0, 0.5);
background-color: Yellow;
}
<div id="bg">
<div id="box"></div>
</div>
Try this
#bg {
text-align: center;
width: 200px;
height: 200px;
padding: 50px;
background: #eeeeee;
}
#box:after {
content:'';
display:block;
position:absolute;
z-index:0;
bottom:0px;
background-image: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0, #9C9C9C),
color-stop(0.22, #EEEEEE)
);
background-image: -o-linear-gradient(bottom, #9C9C9C 0%, #EEEEEE 22%);
background-image: -moz-linear-gradient(bottom, #9C9C9C 0%, #EEEEEE 22%);
background-image: -webkit-linear-gradient(bottom, #9C9C9C 0%, #EEEEEE 22%);
background-image: -ms-linear-gradient(bottom, #9C9C9C 0%, #EEEEEE 22%);
background-image: linear-gradient(to bottom, #9C9C9C 0%, #EEEEEE 22%);
height:10px;
width:100%;
}
#box {
width: 100%;
height: 100%;
position:relative;
background: yellow;
}
https://jsfiddle.net/Lfa4z5b4/
I was just wondering how to align links in a navigation menu in the middle vertically, as I have tried vertical align and it is not working and have searched stack overflow and have found no answers.
Note: the navmenu usually goes the full length of the page and the link are at the top, not in the middle.
Here is the fiddle
Here is the code:
CSS:
* {
padding: 0px;
margin: 0px;
}
.top {
position: fixed;
background-color: red;
border-radius: 10px;
width: 100%;
min-width: 1024px;
height: 100px;
border-radius: 10px;
border: 4px solid white;
}
.left {
position: fixed;
float: left;
margin-top: 5px;
width: 30%;
height: 100%;
background-color: red;
margin-bottom: 10px;
border-radius: 10px;
border: 4px solid white;
}
.menuandtop { bgcolor: yellow; }
.main {
width: 90%;
margin: 0px;
height: 100%;
background-color: pink;
border-radius: 10px;
float: right;
}
a { text-decoration: none; }
.navmenu { list-style-type: none; }
.navmenu li a {
color: #2E2E2E;
font-family: arial;
font-face: arial;
font-weight: bold;
}
ul.navmenu a {
display: block;
text-decoration: none;
}
.navmenu li {
background: rgb(255,50,50);
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmMzIzMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iI2ZmNmQ2ZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUyJSIgc3RvcC1jb2xvcj0iI2ZmMjgyOCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZjAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgba(255,50,50,1) 0%, rgba(255,109,109,1) 50%, rgba(255,40,40,1) 52%, rgba(255,0,0,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255,50,50,1)), color-stop(50%, rgba(255,109,109,1)), color-stop(52%, rgba(255,40,40,1)), color-stop(100%, rgba(255,0,0,1)));
background: -webkit-linear-gradient(top, rgba(255,50,50,1) 0%, rgba(255,109,109,1) 50%, rgba(255,40,40,1) 52%, rgba(255,0,0,1) 100%);
background: -o-linear-gradient(top, rgba(255,50,50,1) 0%, rgba(255,109,109,1) 50%, rgba(255,40,40,1) 52%, rgba(255,0,0,1) 100%);
background: -ms-linear-gradient(top, rgba(255,50,50,1) 0%, rgba(255,109,109,1) 50%, rgba(255,40,40,1) 52%, rgba(255,0,0,1) 100%);
background: linear-gradient(to bottom, rgba(255,50,50,1) 0%, rgba(255,109,109,1) 50%, rgba(255,40,40,1) 52%, rgba(255,0,0,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff3232', endColorstr='#ff0000', GradientType=0 );
filter: none;
height: 20%;
text-align: center;
}
.li1 { border-bottom: 1px solid #2E2E2E; }
.li2 { border-top: 1px solid #2E2E2E; }
.li3 {
border-top: 1px solid #2E2E2E;
border-bottom: 1px solid #2E2E2E;
}
HTML:
<body height="1000px" bgcolor="#2E2E2E">
<div class="menuandtop">
<div class="top"> </div>
<br>
<br>
<br>
<br>
<br>
<div class="left">
<ul class="navmenu">
<li class="li1">Home</li>
<li class="li3">Home</li>
<li class="li3">Home</li>
<li class="li3">Home</li>
<li class="li2">Home</li>
</ul>
</div>
</div>
<div class="footer"> </div>
</body>
There are a few way this can be achieved, one way is to create an invisible inline-block element with 100% height which the navigation is vertically aligned to. Change your CSS in the following way:
.left{
position: fixed;
float: left;
margin-top: 5px;
width: 30%;
height: 100%;
background-color: red;
margin-bottom: 10px;
border-radius: 10px;
border: 4px solid white;
font-size: 0;
}
Font size is set to 0 to remove white space.
.left:after {
content: "";
display: inline-block;
height: 100%;
vertical-align: middle;
width: 0;
}
The :after pseudo-element is used to create the invisible element.
.navmenu{
display: inline-block;
font-size: 16px;
list-style-type: none;
width: 100%;
}
The menu is then set to be inline-block and the font-size set to offset the zeroed font size in the parent element.
http://jsfiddle.net/D7V7p/
here you are:
http://jsfiddle.net/J7P2c/
just add the following code:
.left {
display:table;
}
.navmenu{
display:table-cell;
vertical-align:middle;
}
Update: updated fiddle,
although on firefox it worked fine, on chrome there seemed to be some kind of error produced by the height of the li, so remove the following:
.navmenu li{
height: 20%;
}
Updated fiddle: http://jsfiddle.net/Vr8cv/1/
So I'm working on a layout and have completed the header. When I started working on the body content, I kept running into the issue where the header would overlap the body unless I set a top margin of the body wrapper to something huge (300+px) even then it can overlap when the screen is small. I think I have screwed up the positioning somewhere but I can't seem to figure out how to overcome this.
My HTML:
<body>
<div id="pageWrapper">
<div id="mainHeader">
<div id="mainNav">
<div id="navContent">
<div class="mainLogo"></div>
<div style="display: inline-block;">
<ul>
<li><img class="navIcons" src="http://lifeview.michiganweb.org/img/icons/dashboard.png" />Dashboard</li>
<li><img class="navIcons" src="http://lifeview.michiganweb.org/img/icons/patient.png" />Patients</li>
<li><img class="navIcons" src="http://lifeview.michiganweb.org/img/icons/devices.png" />Devices</li>
<li><img class="navIcons" src="http://lifeview.michiganweb.org/img/icons/account.png" />Account</li>
<li><img class="navIcons" src="http://lifeview.michiganweb.org/img/icons/support.png" />Support</li>
</ul>
</div>
<div class="lvpLogo"><strong>LifeView</strong> Portal</div>
</div>
</div>
<div id="subNav">
<span class="loginName">Doctor Brian Town</span>
</div>
</div>
<div id="bodWrap">
<div class="statWrap"><div class="titleWrap"><span>Chronic Disease Summary</span></div>
<img src="http://lifeview.michiganweb.org/img/icons/support.png" /><img src="img/icons/account.png" /><img src="http://lifeview.michiganweb.org/img/icons/devices.png" /><img src="http://lifeview.michiganweb.org/img/icons/patient.png" />
</div>
<div class="statWrap"><div class="titleWrap"><span>Vital Summary</span></div>
</div>
<div class="statWrap"><div class="titleWrap"><span>Alerts</span></div>
</div>
</div>
</div>
</body>
My CSS:
#charset "utf-8";
body {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 14px;
}
.pageWrapper {
width: 100%;
position: fixed;
}
.mainLogo {
background:url(http://lifeview.michiganweb.org/img/home_02.png) no-repeat left;
height: 77px;
width: 300px;
display: inline-block;
margin-left: 26px;
margin-right: 30px;
float: left;
}
#mainHeader {
position: absolute;
left: 0;
top: 0;
width: 100%;
overflow: hidden;
border: 1px;
}
#mainNav {
/*height: 109px;*/
width: 100%;
float: left;
left: 0px;
margin: 0px;
padding: 0px;
color: #FFFFFF;
/*background:url(http://lifeview.michiganweb.org/img/home_01.jpg) repeat-x scroll top;*/
/* IE10 Consumer Preview */
background-image: -ms-linear-gradient(top, #0e448e 0%, #2b2c2e 100%);
/* Mozilla Firefox */
background-image: -moz-linear-gradient(top, #0e448e 0%, #2b2c2e 100%);
/* Opera */
background-image: -o-linear-gradient(top, #0e448e 0%, #2b2c2e 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #0e448e), color-stop(1, #2b2c2e));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(top, #0e448e 0%, #2b2c2e 100%);
/* W3C Markup, IE10 Release Preview */
background-image: linear-gradient(to bottom, #0e448e 0%, #2b2c2e 100%);
}
#navContent {
padding-top: 20px;
}
#mainNav #navContent ul {
list-style: none;
margin: 0 auto;
padding: 0;
}
#mainNav #navContent li {
float: left;
}
#mainNav #navContent li a {
display: inline-block;
padding: 8px 15px;
text-decoration: none;
font-weight: bold;
color: #FFF;
border-right: 1px solid #ccc;
}
#mainNav #navContent li:first-child a {
border-left: 1px solid #ccc;
}
#mainNav #navContent li a:hover {
color: #23afff;
}
#mainNav #navContent h1 {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 24px;
margin-bottom: 2px;
}
.lvpLogo {
margin: auto auto auto auto;
display: inline-block;
word-spacing: 20px;
vertical-align: top;
float: right;
padding-right: 80px;
}
.lvpLogo strong {
font-family: Verdana, Geneva, sans-serif;
font-size: 36px;
margin-bottom: 2px;
}
.navIcons {
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 1px;
height: 35px;
width: 35px;
}
#subNav {
overflow: hidden;
height: 40px;
width: 100%;
margin: 0px;
padding: 0px;
color: #000000;
/* IE10 Consumer Preview */
background-image: -ms-linear-gradient(top, #FFFFFF 0%, #cccccc 100%);
/* Mozilla Firefox */
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #cccccc 100%);
/* Opera */
background-image: -o-linear-gradient(top, #FFFFFF 0%, #cccccc 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FFFFFF), color-stop(1, #cccccc));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(top, #FFFFFF 0%, #cccccc 100%);
/* W3C Markup, IE10 Release Preview */
background-image: linear-gradient(to bottom, #FFFFFF 0%, #cccccc 100%);
}
.loginName {
float: right;
margin-right: 120px;
color: #000000;
font-weight: bold;
line-height: 40px;
margin-bottom: 2px;
}
#bodWrap {
width: 100%;
left: 0px;
padding: 0px;
color: #000000;
}
.statWrap {
margin: 10px auto auto auto;
border: 2px solid #000;
border-radius: 19px;
width: 80%;
background-color: #eee;
}
.titleWrap {
postion: absolute;
background-color: #00639c;
top: 0;
height: 30px;
border-radius: 30px;
}
.titleWrap span {
color: #FFFFFF;
font-weight: bold;
margin: auto auto auto 33px;
line-height: 30px;
}
JSfiddle:
http://jsfiddle.net/Artsen/tKdqh/
Test Environment:
http://lifeview.michiganweb.org/
I updated your jsfiddle, please see here: updated code
Basically I changed the position:absolute; to a position:relative; for the mainHeader div
Remove position:absolute only from #mainHeader css
DEMO HERE
http://jsfiddle.net/tKdqh/2/