I have a page with one navigation bar that stays always on the bottom of page. I have another div
called <div style="display: block;" id="detail"> that hides the navigation bar(i don't want it to hide the navigation bar)! Could anyone tell me
how I can move the <div style="display: block;" id="detail"> div exactly on the top of navigation div so
both div be visible ? (I tried to changebottom:0px; on detail div to bottom:70px; but it didn't make both
divs visible)
Here is the jsfiddle url for navigation bar alone:https://jsfiddle.net/4mwdkr3p/
Here is the jsfiddle with both div(navigation bar became invisable):https://jsfiddle.net/aq13uwua/2/
ul#navigation {
height: 70px;
#height: max-height: 100%;
min-height: 70px;
list-style: none;
margin: 0;
padding: 0;
border: 1px solid #ccc;
border-width: 1px 0;
text-align: center;
font-size: 12px;
font-family: 'Cham-WebFont', Arial, sans-serif;
background-color: #FFF;
position: fixed;
/* new */
bottom: 0;
/* new */
width: 100%;
/* new */
}
ul#navigation li {
display: inline;
margin-right: .75em;
list-style: none;
margin: 0;
padding: 0;
}
ul#navigation li.last {
margin-right: 0;
}
#MenuContainer {
text-align: center;
margin: 50px auto;
}
#MenuContainer a {
margin: 0px 10px;
display: inline-block;
text-decoration: none;
color: black;
}
#detail {
display: none;
position: fixed;
z-index: 50;
top: 50px;
bottom: 0px;
width: 100%;
color: #FFFFFF;
background: #1b1b1b;
}
#detailContainer {
display: block;
position: relative;
height: 400px;
padding: 30px 10px 10px 10px;
background: url('./icon3.png') no-repeat top center;
text-align: center;
}
#detailContainer img {
display: block;
width: 64px;
height: 64px;
border: 0px;
margin: 40px auto 10px auto;
}
.centerKeyContainer {
display: block;
position: fixed;
text-align: center;
white-space: nowrap;
height: 77px;
width: 100%;
top: 250px;
left: 0px;
right: 0px;
margin: 0px auto;
}
.first {
display: inline-block;
background: url('http://s13.postimg.org/b10yulrlv/playresized.png') no-repeat center center;
background-size: 77px 77px;
width: 77px;
height: 77px;
margin: 0px;
border-right: 5px solid transparent;
}
.second {
display: inline-block;
background: url('http://s10.postimg.org/t5xpfzyhx/mango_Resized.jpg') no-repeat center center;
background-size: 77px 77px;
width: 77px;
height: 77px;
margin: 0px;
border-right: 5px solid transparent;
}
#FavKey {
display: block;
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
height: 72px;
margin: 0px;
text-align: center;
background: #2a2a2a;
}
.addedFav {
display: block;
background: url('http://s28.postimg.org/tkcsrugvh/added.png') no-repeat 0 0;
background-size: 320px 72px;
width: 320px;
height: 72px;
padding: 0px;
bottom: 0;
/* new 70px*/
margin: 0px auto;
}
<div style="display: block;" id="detail">
<div id="detailContainer">
test
<img src="https://www.gstatic.com/webp/gallery3/1.sm.png"><b> Mango</b>
<br>
<span class="centerKeyContainer">
<span class="first" onclick=""></span>
<span class="second" onclick=""></span>
<br>
mango
<br>
</span>
<span id="FavKey"><span class="addedFav"></span></span>
</div>
</div>
<div id="MenuContainer">
<ul id="navigation">
<li class="x">
<a title="1" href="./test.php">
<img id="myButton1" src="http://s24.postimg.org/6nv5v6uu9/worldresized.png" alt="" border="0" height="42" width="42">
<div class="caption">1</div>
</a>
</li>
<li class="x">
<a title="2" href="./test.php">
<img id="myButton2" src="./2.png" alt="" border="0" height="42" width="42">
<div class="caption" style="color:red">2</div>
</a>
</li>
<li class="x">
<a title="3" href="./test.php">
<img id="myButton3" src="./3.png" alt="" border="0" height="42" width="42">
<div class="caption">3</div>
</a>
</li>
<li class="x">
<a title="4" href="./test.php">
<img id="myButton4" src="./4.png" alt="" border="0" height="42" width="42">
<div class="caption">4</div>
</a>
</li>
<li class="x">
<a title="5" href="./test.php">
<img id="myButton5" src="./5.png" alt="" border="0" height="42" width="42">
<div class="caption">5</div>
</a>
</li>
</ul>
</div>
Edit(detail):
I try to explain what i want to achieve.I am creating a webapp for ios so in all pages i want a navigation bar be visible for user at the bottom of page .The detail div holds few buttons to play video and audio and at the end it has an image button to add the current video to favorite .once user click the favorite button its image swap with different image via javascript so user know that his selection added to favorite.All this feature works except that favorite image button(red heart shape)hides the navigation bar below it! I am trying to place the favorite( red heart shaped image button )above navigation bar so both be visible.
You have an <span id="FavKey"> with position: fixed; and bottom: 0px; so it is positioned relative to the browser window. Set position: absolute; to position it relative to the parent (#detailContainer in this case) and you will see the navigation when you set bottom:70px; on #detail
ul#navigation {
height: 70px;
#height: max-height: 100%;
min-height: 70px;
list-style: none;
margin: 0;
padding: 0;
border: 1px solid #ccc;
border-width: 1px 0;
text-align: center;
font-size: 12px;
font-family: 'Cham-WebFont', Arial, sans-serif;
background-color: #FFF;
position: fixed;
/* new */
bottom: 0;
/* new */
width: 100%;
/* new */
}
ul#navigation li {
display: inline;
margin-right: .75em;
list-style: none;
margin: 0;
padding: 0;
}
ul#navigation li.last {
margin-right: 0;
}
#MenuContainer {
text-align: center;
margin: 50px auto;
}
#MenuContainer a {
margin: 0px 10px;
display: inline-block;
text-decoration: none;
color: black;
}
#detail {
display: none;
position: fixed;
z-index: 50;
top: 50px;
bottom: 70px;
width: 100%;
color: #FFFFFF;
background: #1b1b1b;
}
#detailContainer {
display: block;
position: relative;
height: 400px;
padding: 30px 10px 10px 10px;
background: url('./icon3.png') no-repeat top center;
text-align: center;
}
#detailContainer img {
display: block;
width: 64px;
height: 64px;
border: 0px;
margin: 40px auto 10px auto;
}
.centerKeyContainer {
display: block;
position: fixed;
text-align: center;
white-space: nowrap;
height: 77px;
width: 100%;
top: 250px;
left: 0px;
right: 0px;
margin: 0px auto;
}
.first {
display: inline-block;
background: url('./icon1.png') no-repeat center center;
background-size: 77px 77px;
width: 77px;
height: 77px;
margin: 0px;
border-right: 5px solid transparent;
}
.second {
display: inline-block;
background: url('./icon2.png') no-repeat center center;
background-size: 77px 77px;
width: 77px;
height: 77px;
margin: 0px;
border-right: 5px solid transparent;
}
#FavKey {
display: block;
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
height: 72px;
margin: 0px;
text-align: center;
background: #2a2a2a;
}
.addedFav {
display: block;
background: url('./added.png') no-repeat 0 0;
background-size: 320px 72px;
width: 320px;
height: 72px;
padding: 0px;
bottom: 0;
/* new 70px*/
margin: 0px auto;
}
<div style="display: block;" id="detail">
<div id="detailContainer">
test
<img src="./imageone.png"><b> Mango</b>
<br>
<span class="centerKeyContainer">
<span class="first" onclick=""></span>
<span class="second" onclick=""></span>
<br>
mango
<br>
</span>
<span id="FavKey"><span class="addedFav"></span></span>
</div>
</div>
<div id="MenuContainer">
<ul id="navigation">
<li class="x">
<a title="1" href="./test.php">
<img id="myButton1" src="./1.png" alt="" border="0" height="42" width="42">
<div class="caption">1</div>
</a>
</li>
<li class="x">
<a title="2" href="./test.php">
<img id="myButton2" src="./2.png" alt="" border="0" height="42" width="42">
<div class="caption" style="color:red">2</div>
</a>
</li>
<li class="x">
<a title="3" href="./test.php">
<img id="myButton3" src="./3.png" alt="" border="0" height="42" width="42">
<div class="caption">3</div>
</a>
</li>
<li class="x">
<a title="4" href="./test.php">
<img id="myButton4" src="./4.png" alt="" border="0" height="42" width="42">
<div class="caption">4</div>
</a>
</li>
<li class="x">
<a title="5" href="./test.php">
<img id="myButton5" src="./5.png" alt="" border="0" height="42" width="42">
<div class="caption">5</div>
</a>
</li>
</ul>
</div>
Related
I have a small script that generates signatures for mail, but after testing the same in Outlook, it does not recognize the divs, and some other tags.
I'm breaking my head and I can not simulate this signature on a table.
can you help me? Please!
Signature code:
#import url('https://fonts.googleapis.com/css?family=Roboto+Condensed');
#sigCelu{
position: absolute;
left: 92px !important;
top: -1px;
width: 140px;
}
#new_sign{
font-family: 'Roboto Condensed', sans-serif;
width: 100%;
height: auto;
position: relative;
color: #333333 !important;
display: block;
}
#new_sign img{
position: relative;
display: block;
margin-bottom: 5px;
}
#new_sign .barra{
width: 3px;
height: 150px;
background-color: #004375;
position: relative;
display: block;
float: left;
margin-right: 5px;
}
#new_sign .barra2{
width: 3px;
height: 50px;
background-color: #28aa76;
position: relative;
display: block;
float: left;
}
#new_sign #info_sign{
position: relative;
display: block;
margin: 5px 0px 0px 15px;
}
#new_sign #info_sign p span{
position: relative;
display: inline-block;
margin-bottom: 5px;
}
#info_sign img{
position: relative;
display: block;
width: 30px;
height: 30px;
margin-left: -5px;
}
.logos{
margin-top: -7px;
position: relative;
}
#info_sign .logos > span{
position: absolute;
top: 12%;
left: 23px;
}
<div id="new_sign">
<img src="https://i.imgur.com/j4oT9Lz.png" id="sigFoto" alt="logo">
<i class="barra"></i>
<i class="barra2"></i>
<div id="info_sign">
<h3 id="sigName">Nome Aqui</h3>
<p>
<span id="sigTitle">Texto aqui /</span>
<span id="sigCompany">Texto aqui</span>
</p>
<div class="logos">
<img src="https://caoa.com.br/temp/images/icone-telefone.png" alt="#">
<span id="sigMobile">(11) 0000-0000</span>
<span id="celular2">
<span id="sigCelu">| (11) 90000-0000</span>
</span>
</div>
<div class="logos">
<img src="https://caoa.com.br/temp/images/icone-email.png" alt="#">
<span>
<a id="sigEmail">teuemail</a>
</span>
</div>
<div class="logos">
<img src="https://caoa.com.br/temp/images/icone-email-site.png">
<span id="sigWebsite">www.site.com.br</span>
</div>
<div class="logos">
<img src="https://caoa.com.br/temp/images/icone-email-local.png" alt="#">
<span id="sigAddress">Rua, <span id="numero">2822</span>, restante</span>
</div>
</div>
</div>
I can not get familiar with these tables, I believe that because I started right in html5, without messing with tables so much, I've tried several times, consecutive hours working on the code and I do not get a result :(
I am trying to create my header. Which includes a Logo (left), Banner (center) and NavBar (Right). I can get them level with each other but cannot get the banner to sit perfectly central of the page.
The banner is pushed over towards the right, sitting approximately 70% of the way across the screen.
Any ideas as to why this may be happening?
#header1 {
position: absolute;
width: 100%;
height: 100px;
text-align: center;
margin: 0px;
padding-top: 2px;
padding-right: 2px;
padding-left: 2px;
padding-bottom: 2px;
color: white;
font-size: 18px;
background-image: url(content/structure/fmabannerbehind.jpg);
background-position: center;
font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, serif;
font-style: italic;
}
#logo {
margin-left: 0px;
height: 100px;
width: 200px;
float: left;
border-color: red;
border-width: 3px;
border-style: solid;
}
#logo img {
height: 100px;
width: auto;
}
#banner {
position: absolute;
height: 100px;
width: auto;
display: inline-block;
margin: 0 auto;
border-color: red;
border-width: 3px;
border-style: solid;
}
#banner img {
height: 100px;
width: auto;
}
#menu1 {
margin-right: 0px;
height: 100px;
width: auto;
float: right;
border-color: red;
border-width: 3px;
border-style: solid;
}
<div id="header1">
<div id="logo">
<a href="http://www.fmarchived.com">
<img src="/content/structure/logo3.jpg" alt="logo">
</a>
</div>
<div id="banner">
<a href="/">
<img src="/content/structure/fmabanneronly.jpg" alt="banner">
</a>
</div>
<div id="menu1">
<div class="child2menu">
<ul>
<li>About Us
</li>
<li>Facebook
</li>
<li>Twitter
</li>
<li>Youtube
</li>
</ul>
</div>
</div>
</div>
UPDATE
Perhaps I should have explained better, I want the banner to be center
of the entire page, regardless of what the other divs are doing
Then add position:relative to #header1 and position:absolute + display: inline-table; position:absolute; left:0; right:0;
margin:auto; to #banner in both snippets
Option#1 - using CSS flexbox
Using justify-content: space-between from flexbox you can do this, and simplify a lot your code
* {
box-sizing: border-box;
margin: 0
}
#header1 {
display: flex;
justify-content: space-between;
position: relative
}
#header1 > div {
border: solid red
}
img {
vertical-align: bottom
}
#banner {
display: inline-table;
position: absolute;
left: 0;
right: 0;
margin: auto;
}
<div id="header1">
<div id="logo">
<a href="http://www.fmarchived.com">
<img src="//lorempixel.com/200/100" alt="logo">
</a>
</div>
<div id="banner">
<a href="/">
<img src="//lorempixel.com/100/100" alt="banner">
</a>
</div>
<div id="menu1">
<div class="child2menu">
<ul>
<li>About Us
</li>
<li>Facebook
</li>
<li>Twitter
</li>
<li>Youtube
</li>
</ul>
</div>
</div>
</div>
Option#2 - using your current code
Change position:absolute from #header1 to relative to remove scrollbars
* {
box-sizing: border-box;
margin: 0
}
#header1 {
position: relative;
width: 100%;
height: 100px;
text-align: center;
margin: 0;
padding: 2px;
color: white;
font-size: 18px;
background-image: url(content/structure/fmabannerbehind.jpg);
background-position: center;
font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, serif;
font-style: italic;
}
#header1 > div {
border: 3px solid red
}
img {
height: 100px;
width: auto;
vertical-align:bottom
}
#logo {
margin-left: 0;
width: 200px;
float: left;
}
#banner {
width: auto;
display: inline-table;
position:absolute;
left:0;
right:0;
margin:auto;
}
#menu1 {
margin-right: 0px;
float: right;
}
<div id="header1">
<div id="logo">
<a href="http://www.fmarchived.com">
<img src="//lorempixel.com/100/100" alt="logo">
</a>
</div>
<div id="banner">
<a href="/">
<img src="//lorempixel.com/100/100" alt="banner">
</a>
</div>
<div id="menu1">
<div class="child2menu">
<ul>
<li>About Us
</li>
<li>Facebook
</li>
<li>Twitter
</li>
<li>Youtube
</li>
</ul>
</div>
</div>
</div>
Remove the position: absolute property from the #banner div. If the #banner div needs to be absolutely positioned for some reason, you can center it by giving it a width and appropriateleft attribute instead.
Just remove the position absolute and it will align to the center.
#banner {
/*position:absolute;*/
height: 100px;
width: auto;
display: inline-block;
margin:0 auto;
border-color: red;
border-width: 3px;
border-style: solid;
}
you can use coordonates and margin: auto; to center your boxe if tou use absolute . but you need to reset display .
#banner {
position: absolute;
height: 100px;
width: auto;
display: table;/* shrinks on content */
left:0;
right:0;
margin: 0 auto;/* will center in between coordonates if boxe smaller */
border-color: red;
border-width: 3px;
border-style: solid;
}
run code snippet bellow:
#header1 {
position: absolute;
width: 100%;
height: 100px;
text-align: center;
margin: 0px;
padding-top: 2px;
padding-right: 2px;
padding-left: 2px;
padding-bottom: 2px;
color: white;
font-size: 18px;
background-image: url(content/structure/fmabannerbehind.jpg);
background-position: center;
font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, serif;
font-style: italic;
background:linear-gradient(to right,gray 50%, lightgray 50%);
}
#logo {
margin-left: 0px;
height: 100px;
width: 200px;
float: left;
border-color: red;
border-width: 3px;
border-style: solid;
}
#logo img {
height: 100px;
width: auto;
}
#banner {
position: absolute;
height: 100px;
width: auto;
display: table;
margin: 0 auto;
left:0;
right:0;
border-color: red;
border-width: 3px;
border-style: solid;
}
#banner img {
height: 100px;
width: auto;
}
#menu1 {
margin-right: 0px;
height: 100px;
width: auto;
float: right;
border-color: red;
border-width: 3px;
border-style: solid;
}
<div id="header1">
<div id="logo">
<a href="http://www.fmarchived.com">
<img src="/content/structure/logo3.jpg" alt="logo">
</a>
</div>
<div id="banner">
<a href="/">
<img src="/content/structure/fmabanneronly.jpg" alt="banner">
</a>
</div>
<div id="menu1">
<div class="child2menu">
<ul>
<li>About Us
</li>
<li>Facebook
</li>
<li>Twitter
</li>
<li>Youtube
</li>
</ul>
</div>
</div>
</div>
So i'm trying to place some text under an image but for some reason it stays on the right till the container ends and then goes under the image.
I want it to be fully under the image.
And here is the code:
.post {
margin-top: 3px;
width: 80%;
font-size: 20px;
border-bottom: 1px solid #ddd;
}
.post h2 {
font-size: 20px;
cursor: pointer;
}
.post h2:hover {
color: #0099FF;
}
.post img {
display: block;
width: 95%;
height: auto;
float: left;
position: relative;
}
.post p {
display: block;
top: 7px;
font-size: 13px;
color: #999;
}
.rating {
display: inline-block;
}
.rate {
display: inline-block;
height: 34px;
width: 44px;
border: 1px solid #ddd;
border-radius: 3px;
text-align: center;
cursor: pointer;
line-height: 30px;
margin-bottom: 25px;
margin-left: 5px;
}
.rate:first-child {
margin-left: 0;
}
.rate:hover {
border: 1px solid #999;
}
.rate img {
position: relative;
top: 7px;
left: 12px;
width: 20px;
height: 20px;
}
.social {
display: inline-block;
height: 34px;
float: right;
}
.social a img {
display: inline-block;
height: 34px;
width: auto;
margin-right: 10px;
}
<div class="post">
<h2>I know I'm a douche for wearing sunglasses at night but...</h2>
<img src="http://img-9gag-fun.9cache.com/photo/a77Pzr2_700b.jpg" />
<div class="postfooter">
<p>Over 9000 points ยท 56 comments</p>
<div class="rating">
<div class="rate">
<img src="up.png">
</div>
<div class="rate">
<img src="down.png">
</div>
<div class="rate">
<img src="comment.png">
</div>
</div>
<div class="social">
<a href="#">
<img src="facebook.png">
</a>
<a href="#">
<img src="twitter.png">
</a>
<a href="#">
<img src="googleplus.png">
</a>
</div>
</div>
Also it looks alright in chrome for some reason and not alright in FF.
Add css for .postfooter
.postfooter {
clear: both;
}
This will ensure it's on its own line.
I have a page with one navigation bar that stays always on the bottom of page. I have another div
called <div style="display: block;" id="detail"> that hides the navigation bar(i don't want it to hide the navigation bar)! Could anyone tell me
how I can move the <div style="display: block;" id="detail"> div exactly on the top of navigation div so
both div be visible ? (I tried to changebottom:0px; on detail div to bottom:70px; but it didn't make both
divs visible)
Here is the jsfiddle url for navigation bar alone:https://jsfiddle.net/4mwdkr3p/
Here is the jsfiddle with both div(navigation bar became invisable):https://jsfiddle.net/aq13uwua/2/
ul#navigation {
height: 70px;
#height: max-height: 100%;
min-height: 70px;
list-style: none;
margin: 0;
padding: 0;
border: 1px solid #ccc;
border-width: 1px 0;
text-align: center;
font-size: 12px;
font-family: 'Cham-WebFont', Arial, sans-serif;
background-color: #FFF;
position: fixed;
/* new */
bottom: 0;
/* new */
width: 100%;
/* new */
}
ul#navigation li {
display: inline;
margin-right: .75em;
list-style: none;
margin: 0;
padding: 0;
}
ul#navigation li.last {
margin-right: 0;
}
#MenuContainer {
text-align: center;
margin: 50px auto;
}
#MenuContainer a {
margin: 0px 10px;
display: inline-block;
text-decoration: none;
color: black;
}
#detail {
display: none;
position: fixed;
z-index: 50;
top: 50px;
bottom: 0px;
width: 100%;
color: #FFFFFF;
background: #1b1b1b;
}
#detailContainer {
display: block;
position: relative;
height: 400px;
padding: 30px 10px 10px 10px;
background: url('./icon3.png') no-repeat top center;
text-align: center;
}
#detailContainer img {
display: block;
width: 64px;
height: 64px;
border: 0px;
margin: 40px auto 10px auto;
}
.centerKeyContainer {
display: block;
position: fixed;
text-align: center;
white-space: nowrap;
height: 77px;
width: 100%;
top: 250px;
left: 0px;
right: 0px;
margin: 0px auto;
}
.first {
display: inline-block;
background: url('http://s13.postimg.org/b10yulrlv/playresized.png') no-repeat center center;
background-size: 77px 77px;
width: 77px;
height: 77px;
margin: 0px;
border-right: 5px solid transparent;
}
.second {
display: inline-block;
background: url('http://s10.postimg.org/t5xpfzyhx/mango_Resized.jpg') no-repeat center center;
background-size: 77px 77px;
width: 77px;
height: 77px;
margin: 0px;
border-right: 5px solid transparent;
}
#FavKey {
display: block;
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
height: 72px;
margin: 0px;
text-align: center;
background: #2a2a2a;
}
.addedFav {
display: block;
background: url('http://s28.postimg.org/tkcsrugvh/added.png') no-repeat 0 0;
background-size: 320px 72px;
width: 320px;
height: 72px;
padding: 0px;
bottom: 0;
/* new 70px*/
margin: 0px auto;
}
<div style="display: block;" id="detail">
<div id="detailContainer">
test
<img src="https://www.gstatic.com/webp/gallery3/1.sm.png"><b> Mango</b>
<br>
<span class="centerKeyContainer">
<span class="first" onclick=""></span>
<span class="second" onclick=""></span>
<br>
mango
<br>
</span>
<span id="FavKey"><span class="addedFav"></span></span>
</div>
</div>
<div id="MenuContainer">
<ul id="navigation">
<li class="x">
<a title="1" href="./test.php">
<img id="myButton1" src="http://s24.postimg.org/6nv5v6uu9/worldresized.png" alt="" border="0" height="42" width="42">
<div class="caption">1</div>
</a>
</li>
<li class="x">
<a title="2" href="./test.php">
<img id="myButton2" src="./2.png" alt="" border="0" height="42" width="42">
<div class="caption" style="color:red">2</div>
</a>
</li>
<li class="x">
<a title="3" href="./test.php">
<img id="myButton3" src="./3.png" alt="" border="0" height="42" width="42">
<div class="caption">3</div>
</a>
</li>
<li class="x">
<a title="4" href="./test.php">
<img id="myButton4" src="./4.png" alt="" border="0" height="42" width="42">
<div class="caption">4</div>
</a>
</li>
<li class="x">
<a title="5" href="./test.php">
<img id="myButton5" src="./5.png" alt="" border="0" height="42" width="42">
<div class="caption">5</div>
</a>
</li>
</ul>
</div>
Edit(detail):
I try to explain what i want to achieve.I am creating a webapp for ios so in all pages i want a navigation bar be visible for user at the bottom of page .The detail div holds few buttons to play video and audio and at the end it has an image button to add the current video to favorite .once user click the favorite button its image swap with different image via javascript so user know that his selection added to favorite.All this feature works except that favorite image button(red heart shape)hides the navigation bar below it! I am trying to place the favorite( red heart shaped image button )above navigation bar so both be visible.
You have an <span id="FavKey"> with position: fixed; and bottom: 0px; so it is positioned relative to the browser window. Set position: absolute; to position it relative to the parent (#detailContainer in this case) and you will see the navigation when you set bottom:70px; on #detail
ul#navigation {
height: 70px;
#height: max-height: 100%;
min-height: 70px;
list-style: none;
margin: 0;
padding: 0;
border: 1px solid #ccc;
border-width: 1px 0;
text-align: center;
font-size: 12px;
font-family: 'Cham-WebFont', Arial, sans-serif;
background-color: #FFF;
position: fixed;
/* new */
bottom: 0;
/* new */
width: 100%;
/* new */
}
ul#navigation li {
display: inline;
margin-right: .75em;
list-style: none;
margin: 0;
padding: 0;
}
ul#navigation li.last {
margin-right: 0;
}
#MenuContainer {
text-align: center;
margin: 50px auto;
}
#MenuContainer a {
margin: 0px 10px;
display: inline-block;
text-decoration: none;
color: black;
}
#detail {
display: none;
position: fixed;
z-index: 50;
top: 50px;
bottom: 70px;
width: 100%;
color: #FFFFFF;
background: #1b1b1b;
}
#detailContainer {
display: block;
position: relative;
height: 400px;
padding: 30px 10px 10px 10px;
background: url('./icon3.png') no-repeat top center;
text-align: center;
}
#detailContainer img {
display: block;
width: 64px;
height: 64px;
border: 0px;
margin: 40px auto 10px auto;
}
.centerKeyContainer {
display: block;
position: fixed;
text-align: center;
white-space: nowrap;
height: 77px;
width: 100%;
top: 250px;
left: 0px;
right: 0px;
margin: 0px auto;
}
.first {
display: inline-block;
background: url('./icon1.png') no-repeat center center;
background-size: 77px 77px;
width: 77px;
height: 77px;
margin: 0px;
border-right: 5px solid transparent;
}
.second {
display: inline-block;
background: url('./icon2.png') no-repeat center center;
background-size: 77px 77px;
width: 77px;
height: 77px;
margin: 0px;
border-right: 5px solid transparent;
}
#FavKey {
display: block;
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
height: 72px;
margin: 0px;
text-align: center;
background: #2a2a2a;
}
.addedFav {
display: block;
background: url('./added.png') no-repeat 0 0;
background-size: 320px 72px;
width: 320px;
height: 72px;
padding: 0px;
bottom: 0;
/* new 70px*/
margin: 0px auto;
}
<div style="display: block;" id="detail">
<div id="detailContainer">
test
<img src="./imageone.png"><b> Mango</b>
<br>
<span class="centerKeyContainer">
<span class="first" onclick=""></span>
<span class="second" onclick=""></span>
<br>
mango
<br>
</span>
<span id="FavKey"><span class="addedFav"></span></span>
</div>
</div>
<div id="MenuContainer">
<ul id="navigation">
<li class="x">
<a title="1" href="./test.php">
<img id="myButton1" src="./1.png" alt="" border="0" height="42" width="42">
<div class="caption">1</div>
</a>
</li>
<li class="x">
<a title="2" href="./test.php">
<img id="myButton2" src="./2.png" alt="" border="0" height="42" width="42">
<div class="caption" style="color:red">2</div>
</a>
</li>
<li class="x">
<a title="3" href="./test.php">
<img id="myButton3" src="./3.png" alt="" border="0" height="42" width="42">
<div class="caption">3</div>
</a>
</li>
<li class="x">
<a title="4" href="./test.php">
<img id="myButton4" src="./4.png" alt="" border="0" height="42" width="42">
<div class="caption">4</div>
</a>
</li>
<li class="x">
<a title="5" href="./test.php">
<img id="myButton5" src="./5.png" alt="" border="0" height="42" width="42">
<div class="caption">5</div>
</a>
</li>
</ul>
</div>
I am creating a website and this is what it should look like:
http://i.imgur.com/PjsnVPw.png
^^ That is in Internet Explorer
But on Chrome it looks like this: http://i.imgur.com/Ga6le1y.png
As you can see the Top bar on chrome shows completely wrong
The HTML and CSS for this is
HTML
<header>
<img id="logo" src="images/logo.png" alt="Logo">
<div id="topLinks">
<div id="SoicalLinks">
<img src="images/LinkedIn.png" alt="Linkedin logo">
<img src="images/twitterico.png" alt="Twitter Logo">
</div>
<div id="PhoneNumber">
01673 862133
</div>
</div>
<nav>
<ul>
<li><a class="first" href="#">Coaching</a></li>
<li>NLP</li>
<li>Course</li>
<li>Culture Change</li>
<li>Training & Consultancy</li>
</ul>
</nav>
<div class="clear"></div>
<div id="banner">
<div id="face">
<img src="images/webface.png" alt="A side on view of a face">
</div>
<div id="fishwaterimage">
<img src="images/fishwater.png" alt="a Fish with a splash of water">
</div>
<div id="quote">
<p>"...The experience has been first class, I feel privileged to have had this opportunity. Thank you team Dexter."</p>
</div>
<div id="readmore">
<p>Read more testimonials...</p>
</div>
</div>
</header>
and the CSS for all that is
body {
background-image: url(/images/background.png); background-repeat: repeat-x;
margin: 0 auto 0 auto;
width: 1024px;
}
img #logo{
float: right;
width: 325px;
display: inline;
}
#topLinks{
margin: 0 0 0 50px;
width: 250px;
display: inline;
float: right;
}
#PhoneNumber{
padding: 15px;
color: #a7a2a5;
background-color: #000;
float: right;
}
#SoicalLinks{
float: left;
}
nav{
text-align: center;
float: right;
margin: -50px 0 0 0;
width: 600px;
}
nav ul
{
list-style-type:none;
margin:0;
padding:0;
}
nav a
{
font-size: 20px;
color: #383336;
text-decoration: none;
border-left: 1px solid #b22b8d;
display:block;
padding: 0px 10px 0 10px;
}
nav li
{
display: inline;
float: left;
}
nav ul a.first {
border-left: none;
}
#banner{
box-shadow: 1.5px 2.598px 15px 0px rgb( 0, 0, 0 );
width: 900px;
height: 248px;
margin: 0 auto 0 auto;
}
#banner #face{
float: left;
z-index: 2;
position: absolute;
}
#banner #fishwaterimage{
float: right;
margin: 0 0 0 0;
z-index: 1;
}
#banner #quote{
font-size: 26px;
float: left;
z-index: 3;
margin: 25px 0 0 25px;
color: #a7a2a5;
width: 300px;
position:absolute;
}
#banner #readmore{
font-size: 15px;
float: left;
z-index: 3;
margin: 170px 0 0 25px;
color: #a7a2a5;
width: 300px;
position:absolute;
font-style: italic;
}
Anyone with any idea why that is not showing properly in chrome and the fix.
Did you try adding position: absolute or position: relative to the nav bar?