Whenever I change the id of the first subheading from aulas_subheading_2 to aulas_subheading_1. Some strange things happen to my layout, the aulas_heading_1 heading seems to disappear!
It goes from this:
To this:
I inspected the elements with firebug and identified that they are behind the divider, the aulas_heading1_band, which is in position:relative
What's going on here?
The relevant markup:
HTML
<section id="aulas_container">
<div id="aulas_container_top">
<h1 id="aulas_heading_1"><span class="highlight1">Aulas de Inglês</span></h1>
<h2 id="aulas_subheading_2">Práticas Imersivas</h2>
<div id="aulas_heading_band_1"></div>
</div>
<div id="aulas_container_bottom">
<h1 id="aulas_heading_1">Aulas</h1>
<h2 id="aulas_subheading_2"><span class="highlight2">com Professores Nativos</span></h2>
<div id="aulas_subheading_band">a</div>
</div>
CSS
#aulas_container {
background-position: center top;
width: 100%;
float: left;
margin-left: 0;
margin-right: 0;
height: 910px;
}
#aulas_container_top {
width: 100%;
float: left;
margin-left: 0;
margin-right: 0;
height: 50%;
position: relative;
background-image: url("http://i.imgur.com/6Tv6r7F.png");
}
#aulas_container_bottom {
height: 50%;
width: 100%;
float: left;
margin-left: 0;
margin-right: 0;
background-image: url("http://i.imgur.com/YfxsPWu.jpg");
}
/* */
/* TEXT */
/* */
#aulas_heading_1 {
width: 100%;
float: left;
margin-left: 0;
margin-right: 0;
font-size: 50px;
text-align: center;
color: white;
}
#aulas_subheading_1 {
width: 100%;
float: left;
margin-left: 0;
margin-right: 0;
text-align: center;
vertical-align: bottom;
color: white;
}
#aulas_heading_2 {
color: black;
}
#aulas_subheading_2 {
font-size: 60px;
text-align: center;
vertical-align: bottom;
color: black;
}
/* */
/* DIVIDERS AND SHAPES */
/* */
#aulas_heading_band_1 {
width: 100%;
float: left;
margin-left: 0;
margin-right: 0;
height: 35%;
position: relative;
top: -40%;
background-color: black;
}
*#aulas_heading_band_1:before {
content: "";
position: relative;
top: -30%;
background-color: white;
width: 100%;
float: left;
margin-left: 0;
margin-right: 0;
height: 50%;
display: block;
position: relative;
}
#aulas_subheading_band {
background-color: white;
height: 10%;
position: relative;
bottom: 0%;
}
#aulas_subheading_2_band{
background-color: $binaryColor0;
height: 5%;
}
Related
I am trying to deploy my first website. Unfortunately I have a problem with media queries. I don't know how to style media queries for mobile devices for one of my sections.
.row {
margin-right: 0px;
margin-left: 0px;
}
.container-fluid {
padding-right: 0px;
padding-left: 0px;
}
.header {
width: 100%;
height: 100%;
position: relative;
}
.logo-small img {
margin: 0 auto;
width: 30%;
height: 10%;
padding-top: 30px;
margin-left: 60px;
}
.logo-small-retina {
margin: 0 auto;
display: none;
}
.main-logo {
position: relative;
text-align: center;
margin-bottom: 50px;
}
.main-logo img{
width: 15%;
height: 10%;
}
.main-logo-retina{
display: none;
}
.dream-header{
position: relative;
text-align: center;
margin-left: -40px;
}
.dream-header img{
width: 40%;
height: 10%;
}
.dream-header-retina{
display: none;
}
.map{
width: 100%;
height: 100%;
}
.map-retina{
display: none;
}
.ireland{
position: relative;
text-align: center;
margin-top: 65px;
}
.ireland img {
position: relative;
width: 40%;
height: 10%;
margin-top: -4%;
}
.ireland-retina{
display: none;
}
.sandra img {
/*display: block;
position: relative;
width: 105px;
margin-top: -50%;
margin-left: 14%;*/
}
.rollOver {
display: block;
width: 2%;
position: relative;
margin-left: 47.69%;
margin-top: -22.5%;
}
.sandra{
display: none;
position: relative;
width: 250%;
margin-top: -790%;
margin-left: -176%;
}
}
.sandra img {
display: block;
width: 100%;
position: relative;
}
.text-map{
position: relative;
text-align: center;
margin-top: 20%;
margin-bottom: 5%;
}
.text-map img {
position: relative;
width: 40%;
height: 10%;
display: block;
margin-top: 24%;
margin-left: 27%;
margin-right: 27%;
}
.text-map-retina{
display: none;
}
.iradio{
margin-top: 20px;
}
.iradio-logo{
position: relative;
text-align: center;
margin-top: 40px;
margin-bottom: 40px;
}
.iradio-logo-retina{
display: none;
}
.iradio-logo img{
width: 10%;
height: 5%;
}
.garry-text{
position: relative;
text-align: center;
margin-top: 40px;
margin-bottom: 40px;
}
.garry-text img{
width: 20%;
height: 10%;
}
.garry-text-retina{
display: none;
}
.garry{
width: 100%;
/*margin-top: 20px;*/
}
.garrybg{
position: relative;
text-align: center;
margin-top: 40px;
margin-bottom: 40px;
background: url("../images/garry-bg.png") no-repeat;
background-size: 100%;
text-align: center;
}
.centerVideo {
margin: auto;
width:33%;
}
.garrybg-retina{
display: none;
}
.enter{
width: 100%;
/*margin-top: 20px;*/
}
.enter-text{
position: relative;
text-align: center;
margin-top: 40px;
margin-bottom: 5px;
}
.enter-text img{
width: 10%;
height: 5%;
mar
}
.enter-text-retina{
display: none;
}
.win{
width: 100%;
height: 80%;
margin-top: 50px;
padding-top: 50px;
/*margin-top: 20px;*/
}
.chancetowin{
position: relative;
text-align: center;
margin-top: 40px;
margin-bottom: 40px;
}
.chancetowin img{
width: 70%;
height: 55%;
mar
}
.chancetowin-retina{
display: none;
}
::-webkit-input-placeholder {
color: red;
font-weight: bold;
}
:-moz-placeholder {
color: red;
font-weight: bold;
}
:-ms-input-placeholder {
color: red;
font-weight: bold;
}
.social-retina{
display: none;
}
.form-control{
margin-bottom: 5px;
}
.btn-submit{
width: 75%;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
margin-bottom: 50px;
display: block;
}
#btn {
border: 0;
text-align: center;
width: 80px;
margin-left: 50%;
margin-right: 50%;
margin-top: 10px;
}
#share{
text-align: center;
display: block;
width: 30%;
height: 10%;
margin-right: auto;
margin-left: auto;
padding-top: 20px;
padding-bottom: 20px;
}
.player .title{
display: none;
}
.fb-share-button{
margin: 4px 10px 0px 10px;
margin
display: block;
position: relative;
float: left;
}
.twitter-share-button{
margin: 10px;
display: block;
position: relative;
}
.footer{
position: relative;
width: 100%;
height: 100%;
}
.footer-vid{
width: 100%;
height: 700px;
}
.footer-vid-retina{
display: none;
}
#media only screen and (max-width: 400px){
.container-fluid{
width: 100%;
}
.row{
position: relative;
width: 100%;
}
.header{
width: 100%;
position: relative;
}
.logo-small{
display: none;
}
.logo-small-retina{
display: block;
position: relative;
padding-top: 10px;
margin-left: 10px;
}
.main-logo{
display: none;
}
.main-logo-retina{
display: block;
}
.main-logo-retina img{
position: relative;
width: 150px;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 105px;
margin-right: 105px;
}
.dream-header{
display: none;
}
.dream-header-retina{
display: block;
}
.dream-header-retina img {
position: relative;
width: 318px;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 7px;
margin-right: 7px;
}
.map{
display: none;
}
.map-retina{
display: block;
}
.ireland{
display: none;
}
.ireland-retina{
display: block;
}
.ireland-retina img {
position: relative;
width: 318px;
margin-top: -5px;
margin-bottom: 10px;
margin-left: 7px;
margin-right: 7px;
}
.text-map{
display: none;
}
.text-map-retina{
display: block;
}
.text-map-retina img {
position: relative;
width: 318px;
margin-top: 35px;
margin-bottom: 10px;
margin-left: 7px;
margin-right: 7px;
}
.iradio{
width: 330px;
position: relative;
}
.iradio-logo{
display: none;
}
.iradio-logo-retina{
display:block;
}
.iradio-logo-retina img {
position: relative;
width: 40%;
margin-top: -12px;
margin-bottom: 10px;
margin-left: 93px;
margin-right: 69px;
}
.garry-text{
display: none;
}
.garry-text-retina{
display: block;
}
.garry-text-retina img {
position: relative;
width: 200px;
margin-top: 0;
margin-bottom: -31px;
margin-left: 69px;
margin-right: 69px;
}
.garrybg{
background: none;
}
.centerVideo{
width: 100%;
}
/* .garrybg-retina{
display: block;
height: 40px;
}
.garrybg-retina img {
position: relative;
width: 400px;
margin-top: -246px;
margin-bottom: -240px;
margin-left: -23px;
margin-right: 69px;
}*/
#garry-vid-retina{
margin-left: 117px;
margin-bottom: 0;
z-index: 1;
bottom: -48px;
}
.enter-text{
display: none;
}
.enter-text-retina{
display: block;
}
.enter-text-retina img {
position: relative;
width: 200px;
margin-top: -136px;
margin-bottom: -138px;
margin-left: 65px;
margin-right: 65px;
}
.win {
position: relative;
width: 100%;
height: 80%;
margin-top: 44px;
padding-top: 50px;
/* margin-top: 20px; */
}
.chancetowin{
display: none;
}
.chancetowin-retina{
display: block;
}
.chancetowin-retina img{
position: relative;
width: 340px;
margin-top: -35px;
margin-left: 6px;
margin-right: 6px;
}
.social{
display: none;
}
.social-retina{
display:block;
position: relative;
width: 100%;
}
.footer-vid{
position: relative;
width: 100%;
max-height: 100%;
height: 242px;
}
}
<section class="contact-us" id="contact">
<div class="containernew">
<h2>text</h2>
<p>text text text text text text text text text text text text text text text text</p>
<p style="margin-bottom: 10px;"><i class="fas fa-phone"></i> 312 432 321</p>
<p><i class="fas fa-envelope"></i> #gmail.com</p>
<div class="contact-box">
<form action="POST" data-netlify=true netlify name="form">
<div class="name-email"><input type="text" placeholder="Imię " name="Imię">
<input type="email" placeholder="Email" name="Email"></div>
<div class="subject"><input type="text" placeholder="Temat" name="Temat"></div>
<div class="message"><textarea name="Your text" id="" cols="30" rows="10"
placeholder="Twoja wiadomość"></textarea></div>
<button>Wyślij wiadomość</button>
<div data-netlify-recaptcha ></div>
</form>
</div>
</div>
</section>
I tried to style .containernew why media queries but width and max-width seem to not work somehow.
It would be useful if you could put your code through the W3C validator https://validator.w3.org/
There are several problems in the CSS given in the question such as a spurious right brace, plus some ‘floating’ declarations that are not terminated properly, e.g. margin
If you still have problems when these errors are removed, put a snippet into your question which shows the problem you are having and we can have another look.
I try to make a responsive website but I tend to believe because I'm using positiong + right and left it makes me some serious problems. I need to do that without grid.
That's what happens when I make the window a little bit smaller, some of it go left: https://i.imagesup.co/images2/cdf13e4d1939b4041c55ab3b59799762e3d8f32d.png.
And when it gets to the media query it's definitely not responsive. Every change in the window size under 786px seem differently.
https://i.imagesup.co/images2/007f47c1df59bdf745a531d55c9c8965270508aa.png
Only the what inside the first white box + what's inside + what above is really responsive.
CSS
body {
margin: auto 0;
direction: rtl;
background-color:#F0F0F0;
}
.img-center {
display: block;
margin: 0 auto;
}
#img-below {
border: 5px solid white;
border-radius: 100%;
height: 8%;
width: 8%;
position: relative;
bottom: 80px;
}
h1 {
color:#0099ff;
text-align: center;
position: relative;
bottom: 120px;
font-size: 50px;
font-family: 'M PLUS Rounded 1c', sans-serif;
}
h2 {
color: gray;
font-size: 30px;
text-align: center;
font-size: 30px;
position: relative;
bottom: 157px;
font-family: 'M PLUS Rounded 1c', sans-serif;
}
.icons {
height: 50px;
width: 50px;
border: #0099ff 5px solid;
padding: 5px;
border-radius: 100%;;
margin-right: 15px;
}
#DivIcons {
display: flex;
flex-direction: row;
justify-content: center;
position: relative;
bottom: 170px;
}
p {
font-family: 'M PLUS Rounded 1c', sans-serif;
font-size: 15px;
}
article {
width: 160px;
margin-bottom: 5px;
position: relative;
bottom: 455px;
right: 397px;
}
h3 {
font-family: 'M PLUS Rounded 1c', sans-serif;
}
.square {
border:5px solid #0099ff;
height: 80px;
width: 80px;
margin-left: 20px;
border-radius: 30%;
}
.circle {
border:5px solid #0099ff;
border-radius: 100%;
height: 80px;
width: 80px;
margin-left: 20px;
}
.Pservice {
color: #0099ff;
text-align: center;
position: relative;
top: 12px;
}
#service {
display: flex;
flex-direction: row;
position: relative;
bottom: 1710px;
right: 440px;
}
#position3 {
position: relative;
bottom: 70px;
right: 157px;
}
#form {
position: relative;
bottom: 1830px;
right: 593px;
}
input {
border-radius: 6px;
}
input:nth-child(1)
{
width: 250px;
height: 20px;
margin-left: 10px;
}
input:nth-child(2)
{
width: 250px;
height: 20px;
}
#textarea {
width: 520px;
height: 250px;
margin-bottom: 10px;
}
#submit {
background-color: #0099ff;
color: white;
height: 50px;
width: 120px;
position: relative;
right: 200px;
bottom: 10px;
cursor: pointer;
}
#FirstWhite{
width: 750px;
height: 320px;
background-color: white;
margin: 0 auto;
position: relative;
bottom: 460px;
z-index: -1;
margin-bottom: 5px;
}
#AboutWhite {
width: 180px;
height: 650px;
background-color: white;
position: relative;
bottom: 1113px;
right: 385px;
z-index: -1;
}
#ServiceWhite {
width: 555px;
height: 165px;
background-color: white;
z-index: -1;
position: relative;
bottom: 1855px;
right: 580px;
}
#FooterWhite {
width: 555px;
height: 463px;
background-color: white;
z-index: -1;
position: relative;
bottom: 2292px;
right: 580px;
}
#media screen and (max-width:768px)
{
#img-main {
width: 100vw;
height: 150px;
}
#img-below {
width: 30vw;
height: 30vh;
margin-bottom: 10px;
}
h1, h2 {
font-size: 7vw;
position: relative;
bottom: 100px;
margin: 0 auto;
font-family: 'M PLUS Rounded 1c', sans-serif;
}
#flex-mobile1 {
display: flex;
flex-direction: row;
position: relative;
top: 70px;
right: 120px;
margin-top: 10px;
}
#flex-mobile2 {
display: flex;
flex-direction: row;
position: relative;
top: 150px;
left: 133px;
margin-top: 10px;
}
#FirstWhite{
width: 100vw;
height: 500px;
background-color: white;
display: block;
margin: 0 auto;
position: relative;
bottom: 490px;
z-index: -1;
margin-bottom: 5px;
}
#AboutWhite {
width: 100vw;
height: 300px;
background-color: white;
position: relative;
right: 0px;
bottom: 588px;
}
article {
position: relative;
right: 0px;
width: 85vw;
margin-right: 10px;
height: 100px;
}
#ServiceWhite
{
position: relative;
bottom: 650px;
right: 0px;
width: 100vw;
}
#service
{
position: relative;
bottom: 500px;
right: -120px;
}
#FooterWhite
{
position: relative;
bottom: 1080px;
right: 0px;
width: 100vw;
}
#form {
position: relative;
right: 0px;
bottom: 620px;
margin-right: 15px;
}
#inside-form {
position: relative;
right: 40px;
}
}
Link to Codepen
Hope this code helps you to build on top it. As of now the media query is set for 600px, you may change it to your desired break point.
* {
margin: 0;
padding: 0;
}
html {
font-size: 10px;
}
body {
background-color: #f0f0f0;
}
.container {
max-width: 800px;
margin: auto;
}
header {
position: relative;
}
.header-img {
width: 100%;
}
.rounded-img {
position: absolute;
height: 140px;
width: 140px;
border-radius: 50%;
border: 2px solid #fff;
overflow: hidden;
left: 50%;
transform: translate(-50%);
bottom: -60px;
}
.rounded-img img {
width: 100%;
height: 100%;
}
h1,
h2 {
font-family: "M PLUS Rounded 1c", sans-serif;
text-align: center;
}
.titles {
background-color: #fff;
padding-bottom: 40px;
}
h1 {
color: #0099ff;
font-size: 5rem;
padding: 60px 20px 0 20px;
}
h2 {
color: #808080;
font-size: 2.4rem;
}
.icons {
display: flex;
justify-content: center;
margin-top: 30px;
}
.icons a {
width: 40px;
height: 40px;
overflow: hidden;
margin: 0 15px;
border: 5px solid #0099ff;
padding: 10px;
border-radius: 50%;
}
.icons a img {
width: 100%;
height: 100%;
}
.content-section {
display: flex;
margin: 20px 0;
}
.article-right,
.article-left {
font-size: 1.6rem;
font-family: "M PLUS Rounded 1c", sans-serif;
}
.article-right {
order: 2;
width: 180px;
margin-left: auto;
text-align: right;
background-color: #fff;
padding: 20px;
box-sizing: border-box;
}
.article-left {
display: flex;
flex-direction: column;
flex: 1;
margin-right: 20px;
}
.article-left div {
text-align: right;
width: 100%;
background-color: #fff;
padding: 20px;
box-sizing: border-box;
}
.article-left .shapes-section {
margin-bottom: 30px;
}
.article-left .form-section {
margin-bottom: 50px;
}
#media screen and (max-width: 600px) {
.icons {
flex-wrap: wrap;
margin-top: 10px;
}
.icons a {
margin-top: 20px;
}
.content-section {
flex-direction: column;
}
.article-right,
.article-left,
.article-left .shapes-section,
.article-left .form-section {
text-align: center;
}
.article-left {
order: 2;
margin-right: 0;
}
.article-right {
margin-right: auto;
margin-bottom: 30px;
width: 100%;
}
}
<div class="container">
<header>
<img class="header-img" src="https://www.westsidemovement.com/wp-content/uploads/2018/03/Lets-Go-Scripture-800x200.jpg" alt="" />
<div class="rounded-img">
<img src="https://thumbor.forbes.com/thumbor/960x0/https%3A%2F%2Fblogs-images.forbes.com%2Frainerzitelmann%2Ffiles%2F2019%2F06%2FE0MG76-e1560965378507-1200x1270.jpg" alt="" />
</div>
</header>
<main>
<section class="titles">
<h1>אלברט איינשטיין</h1>
<h2>פיזיקאי תיאורטי</h2>
<div class="icons">
<a href="#">
<img src="https://cdn4.iconfinder.com/data/icons/social-media-logos-6/512/10-waze-512.png" alt="" />
</a>
<a href="#">
<img src="https://thebrightwork.com/wp-content/uploads/2014/04/facebook-icon-blue.png" alt="" />
</a>
<a href="#">
<img src="https://cdn2.iconfinder.com/data/icons/basic-thin-line-color/21/20-512.png" alt="" />
</a>
<a href="#">
<img src="https://www.trzcacak.rs/myfile/full/311-3111799_social-media-computer-icons-logo-blue-area-png.png" alt="" />
</a>
<a href="#">
<img src="https://img.icons8.com/ultraviolet/452/whatsapp.png" alt="" />
</a>
<a href="#">
<img src="https://cdn2.iconfinder.com/data/icons/thin-line-color-1/21/13-512.png" alt="" />
</a>
</div>
</section>
<section class="content-section">
<article class="article-right">
your right content
</article>
<article class="article-left">
<div class="shapes-section">
shapes content here
</div>
<div class="form-section">
form here
</div>
</article>
</section>
</main>
</div>
Whenever i try to move separator up or down, the element h1 above .separator class starts moving along with the separator. Is there any easy way to get rid of this issue?
Below is my HTML/CSS Code
.banner img {
width: 100%;
height: 100%;
}
.banner {
position: relative;
margin: -0.6%
}
.OverLay {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.OverLayContent {
width: 100%;
height: 100%;
display: table;
}
.overLayDescription {
width: 70%;
margin: 0 auto;
}
.OverLayText {
width: 100%;
height: 100%;
display: table-cell;
vertical-align: middle;
text-align: center;
}
.OverLayText h1 {
margin-bottom: 5%;
color: #FFF;
font-size: 120px;
/*border-bottom: 2px solid #15a4fa;*/
}
.separator {
margin: 0 auto;
width: 50%;
background-color: #15a4fa;
height: 2px;
margin-bottom: 10.4%;
}
.OverLayText a {
color: #FFF;
border: 1px solid #15a4fa;
padding: 10px;
}
.OverLayText p {
color: #FFF;
margin-top: 2%;
margin-bottom: 3%;
}
.OverLayContent {
position: relative;
}
<div class="banner">
<img src="http://cometoart.com/wp-content/uploads/2016/03/pojo-placeholder-2.png" />
<div class="OverLay">
<div class="OverLayContent">
<div class="OverLayText">
<h1>STRICT</h1>
<dir class="separator"></dir>
<p>STRICT is a responsive theme with a a clean and minimal look.</p>
Call to action
</div>
</div>
</div>
</div>
Just because you are using .OverLayText to vertically-align:middle;.
.banner img {
width: 100%;
height: 100%;
position: relative;
}
.banner {
position: relative;
margin: -0.6%
}
.OverLay {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.OverLayContent {
width: 100%;
height: 100%;
display: table;
}
.overLayDescription {
width: 70%;
margin: 0 auto;
}
.OverLayText {
width: 100%;
height: 100%;
display: table-cell;
vertical-align: middle;
text-align: center;
vertically-align:middle;
}
.OverLayText h1 {
margin-bottom: 5%;
color: #FFF;
font-size: 120px;
/*border-bottom: 2px solid #15a4fa;*/
}
.separator {
/*margin: 0 auto;*/
width: 50%;
background-color: #15a4fa;
height: 2px;
/*top: 80%;*/
position: relative;
margin: auto;
text-align: center;
display: block;
}
.OverLayText a {
color: #FFF;
border: 1px solid #15a4fa;
padding: 10px;
}
.OverLayText p {
color: #FFF;
margin-top: 2%;
margin-bottom: 3%;
}
.OverLayContent {
position: relative;
}
<div class="banner">
<img src="http://cometoart.com/wp-content/uploads/2016/03/pojo-placeholder-2.png" />
<div class="OverLay">
<div class="OverLayContent">
<div class="OverLayText">
<h1>STRICT</h1>
<dir class="separator"></dir>
<p>STRICT is a responsive theme with a a clean and minimal look.</p>
Call to action
</div>
</div>
</div>
</div>
I'm currently working on a website and have encountered an interesting problem. I have a container which holds my navbar. For some reason, this container displays behind its contents (Which it should) but mouse interaction acts as if it's in front of its contents.
JSFiddle of my current code
https://jsfiddle.net/qzsxpgrq/
HTML
<div id="navbar">
<div id="bar">
<div id="navLeft">
<div class="navL navbutton">About</div>
<div class="navL navbutton">The Team</div>
</div>
<div id="navLogo">
<div id="logo">
<img src="http://www.epicyoobed.com/res/img/navLogo.png"/>
</div>
</div>
<div id="navRight">
<div class="navR navbutton">Programs</div>
<div class="navR navbutton">Contact</div>
</div>
</div>
</div>
CSS
html {
height: 100%;
font-family: arial;
}
body {
margin: 0;
padding: 0;
background-color: #BBB;
}
#navbar {
margin: 0;
padding: 0;
height: 80px;
width: 100%;
position: fixed;
display: block;
z-index: 1;
}
#bar {
display: block;
position: fixed;
width: 100%;
height: 40px;
background-image: url("http://www.epicyoobed.com/res/img/nav.png");
}
#navRight {
margin: 0;
padding: 0;
height: 40px;
width: 45%;
position: absolute;
display: block;
float: left;
top: 0;
right: 0;
}
#navbar div div a {
display: block;
text-decoration: none;
padding-top: 5px;
color: #000;
width: 100%;
height: 100%;
font-size: 20px;
}
.current {
background-image: url("http://www.epicyoobed.com/res/img/nav_sel.png");
background-repeat: repeat-x;
}
.navL {
float: right;
}
.navR {
float: left;
}
.navbutton {
display: block;
position: relative;
width: 150px;
height: 100%;
text-align: center;
}
.navbutton:hover {
background-image: url("http://www.epicyoobed.com/res/img/nav_sel.png");
background-repeat: repeat-x;
}
#navLogo {
margin: auto;
height: 40px;
width: 100%;
position: absolute;
display: block;
z-index: 2;
}
#logo {
margin: auto;
height: 80px;
width: 80px;
}
#navLeft {
margin: 0;
padding: 0;
height: 40px;
width: 45%;
position: absolute;
display: block;
float: right;
}
Xetanai Try adding a z-index of 3 to the #navLeft and navRight.
#navLeft {
margin: 0;
padding: 0;
height: 40px;
width: 45%;
position: absolute;
display: block;
float: right;
z-index:3;
}
#navRight {
margin: 0;
padding: 0;
height: 40px;
width: 45%;
position: absolute;
display: block;
float: left;
top: 0;
right: 0;
z-index:3;
}
The issue you're experiencing is because the logo is 100% width and has a z-index of 2. Effectively placing it above the left and right containers.
I'm working on building a responsive website and I have run into an issue where, upon scrolling, there looks to be about two or three extra pixels at the bottom of the page beyond the content.
I'm not sure where they're coming from or how to get rid of them. They appear to be inside of the overall container but outside of the header and content blocks. I'm assuming it's some kind of margin issue?
Any assistance would be greatly appreciated!
JS Fiddle here: http://jsfiddle.net/BramVanroy/toxk8Lde/1/
HTML
<div id="container">
<div id="header">
<div id="headerLeft">
<div id="logo">
<img src="http://mbeach.me/arch/images/layout/logo_100.png" alt="MILES Arch Logo" id="miles_arch_logo" />
</div>
<div id="companyName">
<span id="miles_arch">MILES architecture group</span>
</div>
</div>
<div id="headerRight">
<div id="navMenu">
<img src="http://mbeach.me/arch/images/layout/menu_button.png" id="nav_menu_button" alt="menu_button" />
</div>
</div>
</div>
<div id="content">
<div id="slideshow">
<img src="http://mbeach.me/arch/images/layout/main_background.jpg" alt="" />
<div id="leftRight"></div>
<div id="buttons"></div>
</div>
</div>
</div>
CSS
html {
font-size: 100%;
}
body {
font-size: 1em;
background:;
}
#container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0px solid yellow;
}
#header {
width: 100%;
background: #fff;
border-bottom: 4px solid #ffa500;
display: inline-block;
}
#headerLeft {
display: inherit;
padding-bottom: 26px;
}
#logo {
display: inherit;
}
#miles_arch_logo {
position: relative;
top: 15px;
margin-left: 30px;
width: 100px;
height: 101px;
}
#companyName {
margin-left: 92px;
margin-right: 37px;
display: inherit;
font-size: 32px;
position: relative;
top: -20px;
color: #105697;
font-family: arial, sans-serif;
letter-spacing: .05em;
/* Below rescales font: first number is horizontal, second is vertical. */
transform: scale(1.2, .8);
/* W3C */
-webkit-transform: scale(1.2, .8);
/* Safari and Chrome */
-moz-transform: scale(1.2, .8);
/* Firefox */
-ms-transform: scale(1.2, .8);
/* IE 9 */
-o-transform: scale(1.2, .8);
/* Opera */
}
#headerRight {
display: inherit;
}
#navMenu {
width: 50px;
height: 41px;
position: absolute;
right: 44px;
top: 44px;
}
#nav_menu_button {
width: 50px;
height: 41px;
}
#content {
width: 100%;
max-width: 100%;
position: absolute;
top: 136px;
bottom: 0px;
border-bottom: 0px solid yellow;
margin: 0;
padding: 0;
}
#slideshow {
overflow: hidden;
}
#slideshow img {
width: 100%;
/*position: relative;
margin-top: -100px;*/
}
#leftRight {
position: absolute;
border: 0px solid red;
top: 0px;
width: 50px;
height: 50px;
}
#buttons {
position: absolute;
border: 0px solid red;
top: 0px;
left: 50px;
width: 50px;
height: 50px;
}
/* Resizes header info depending on screen size. */
#media (max-width: 1375px) {
/*#slideshow {
height: 531px;
overflow: hidden;
}
#slideshow img {
width: 100%;
border: 0px solid red;
}*/
}
#media (max-width: 800px) {
/*#slideshow {
height: 428px;
overflow: hidden;
}
#slideshow img {
width: 800px;
border: 0px solid red;
}*/
#companyName {
font-size: 22px;
margin-left: 52px;
margin-right: 37px;
}
#miles_arch_logo {
width: 70%;
height: 70%;
}
#nav_menu_button {
width: 80%;
height: 80%;
}
#content {
top: 126px;
}
}
#media (max-width: 700px) {
#companyName {
font-size: 18px;
margin-left: 22px;
margin-right: 37px;
top: -10px;
}
#miles_arch_logo {
width: 50%;
height: 50%;
}
#navMenu {
right: 20px;
top: 35px;
}
#nav_menu_button {
width: 60%;
height: 60%;
}
#content {
top: 99px;
}
}
#media (max-width: 500px) {
#companyName {
font-size: 16px;
margin-left: 22px;
margin-right: 37px;
top: 2px;
}
#miles_arch_logo {
width: 35%;
height: 35%;
}
#navMenu {
right: 8px;
top: 28px;
}
#nav_menu_button {
width: 55%;
height: 55%;
}
#content {
top: 79px;
}
}
#media (max-width: 425px) {
#companyName {
font-size: 12px;
margin-left: 2px;
margin-right: 37px;
top: 2px;
}
#miles_arch_logo {
width: 30%;
height: 30%;
}
#navMenu {
right: 5px;
top: 28px;
}
#nav_menu_button {
width: 50%;
height: 50%;
}
#content {
top: 72px;
}
}
Set your img's style to include display: block; or vertical-align: middle;
http://jsfiddle.net/85a6a52t/1/ (See very bottom of CSS panel)
#slideshow img { display: block; }
or
#slideshow img { vertical-align: middle; }
Reference to this good answer that explains issue