Div disappears removing height constraint - html

I need to build a small website and I'm having problems with the page resizing.
I want that the png image that I put as header is resizable with the whole page (zooming in or out).
I use this css
div#container {
overflow: hidden;
min-width:900px;
width:50%;
margin:0px auto;
background-color:#ffffff;
}
div#header {
background: url('header.png') no-repeat center center;
height:20%;
min-width:900px;
width:inherit;
margin:0px auto;
position:relative;
}
div#upper_nav {
position: absolute;
bottom:0%;
right:0%;
text-align:center;
z-index:9999;
background-color:#e6e6e6;
}
and here the html part
<div id="upper_nav">
<ul id="menu_header">
<li class="active">Home</li>
<li>Link11</li>
<li>Link22</li>
<li>Link33</li>
<li>Link44</li>
</ul>
</div>
Here a link with the test code: https://jsfiddle.net/809ofmvr/1/ I don't know how to add image in the test. Let's say that in the upper part there is the header image and in the bottom part the footer.
I use for the header, a div header and inside the upper_nav div with some links. I think the problem is inside the header div but I don't know where. I also tried to replace position:relative; with display:block; but gives me the same problem.
What can I do to allow a complete resize of the entire page when changes the monitor resolution, zoom, using a smartphone or whatever? With the content it resizes in the correct way.

You can use 20vw to force the header to have a height:
html {
margin:0;
padding:0;
background-color:#ffffff;
}
body {
font-family: Tahoma, Geneva, sans-serif;
color:#000;
text-align:justify;
background-image: url('http://placehold.it/800x200');
background-repeat: no-repeat;
background-attachment:fixed;
background-size: cover;
}
div#container {
overflow: hidden;
min-width:900px;
/*max-width:2000px;*/
width:50%;
margin:0px auto;
background-color:#ffffff;
}
div#header {
background: url('http://placehold.it/800x200') no-repeat center center;
background-size: cover;
height:20vw;
min-width:900px;
width:inherit;
margin:0px auto;
position:relative;
}
div#upper_nav {
position: absolute;
bottom:0%;
right:0%;
text-align:center;
z-index:9999;
background-color:#e6e6e6;
}
div#navigation_left {
padding:5px 5px;
float: left;
width:22%;
background-color:#e6e6e6;
box-shadow: 5px 5px 2px #888888;
padding-bottom: 99999px; margin-bottom: -99999px;
}
div#content {
overflow:auto;
margin-left:25%;
background-color:#e6e6e6;
box-shadow: 5px 5px 2px #888888;
padding-bottom: 99999px; margin-bottom: -99999px;
}
div#footer {
clear:both;
background: url('footer.png') no-repeat center center;
height:105px;
position:relative;
}
div#footer_content {
position: relative;
bottom:-50%;
text-align:center;
z-index:9999;
background-color:#fff;
}
P {
font-size: 17px;
color:#000;
font-family:Tahoma;
}
a {
text-decoration: none;
color:#0066FF;
font-size: 17px;
}
a:hover {
color: #0066FF;
text-decoration: underline
}
h1 {
background-color: #737373;
color: #fff;
font-family: verdana;
font-size: 200%;
}
h2,h3,h4,h5,h6,h7,h8 {
background-color: #737373;
color: #fff;
font-family: verdana;
font-size: 150%;
}
ul#menu_left{
font-size: 11px;
list-style: none;
}
ul#menu_left li {
display: block;
width: 150px;
height: 30px;
margin: 2px;
}
ul#menu_left li a {
color:#000;
display: block;
line-height: 30px;
text-decoration: none;
text-align: left;
}
ul#menu_left li.active, ul#menu_left li:hover {
background-color: #c9c9c9;
}
ul#menu_header {
font-size: 11px;
margin: 0;
padding: 0;
list-style: none;
}
ul#menu_header li {
background-color: #737373;
display: block;
width: 150px;
height: 30px;
margin: 2px;
float: left; /* elementi su singola riga */
}
ul#menu_header li a {
color: #fff;
display: block;
line-height: 30px;
text-decoration: none;
width: 150px;
height: 30px;
text-align: center;
}
ul#menu_header li.active, ul#menu_header li:hover {
background-color: #b1b1b1;
}
<div id="container">
<div id="header">
<div id="upper_nav">
<ul id="menu_header">
<li class="active">Home</li>
<li>Link11</li>
<li>Link22</li>
<li>Link33</li>
<li>Link44</li>
</ul>
</div>
</div>
<div id="navigation_left">
<ul id="menu_left">
<a hfre="#">links</a>
</ul>
</div>
<div id="content"><p>text</p></div>
<div id="footer"><div id="footer_content">text</div></div>
</div>
Also, I added background-size: cover; to make sure the background image always fills the container

Related

In mobile devices the site does not respond propertly but on desktop it works perfectly fine

I have this html code of my home page. The website is wwww.chatziefraimidis.com. It works perfectly fine in a desktop browser but in mobile the footer and the header are smaller than the screen and that even more weirdly happens only on the home page and on the other pages with exactly the same code it works both on desktop and mobile browser correctly. Does anyone know how to fix this?
and the coresponding css code is
body{
font: 15px/1.5 "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
padding: 0;
margin:0;
font-weight:normal;
background: #f6f6f6;
}
/*Global*/
.container{
width:90%;
margin:auto;
overflow:hidden;
}
header ul{
margin:0;
padding:0;
}
.button_1{
height:32px;
background:#7B68EE;
border: 0;
padding-left:20px;
padding-right:20px;
color:#ffffff;
}
.dark{
padding:15px;
background:#35424a;
color:#ffffff;
margin-top:10px;
margin-bottom: 10px;
}
/*Header**/
header{
background: #35424a;
color:#ffffff;
padding-top:20px;
min-height: 70px;
border-bottom: #7B68EE 5px solid;
}
header a{
color:#f4f4f4;
text-decoration: none;
text-transform: uppercase;
font-size: 16px;
}
header li{
float:left;
display:inline;
padding: 0 16px 0 16px;
}
header #branding{
float:left;
}
header #branding h1{
margin:0;
}
header nav{
float:right;
margin-top: 15px;
}
header .highlight, header .current a{
color:#7B68EE;
font-weight:normal;
}
header .current2 a{
color:#000000;
font-weight:normal;
}
header a:hover{
color:#cccccc;
font-weight: bold;
}
/* showcase*/
#showcase{
min-height:600px;
min-width:500px;
background:url('../img/showcase.png') no-repeat 0 -100px ;
background-position: center;
background-size:100%;
text-align:center;
color: #ffffff;
}
#showcase h1{
margin-top:100px;
font-size:50px;
margin-bottom:10px;
background: #35424a ;
opacity: 0.6;
}
#showcase p{
font-size:20px;
background: #35424a ;
opacity: 0.6;
}
/*newsletter*/
#newsletter{
padding:15px;
color:#ffffff;
background:#35424a;
}
#newsletter h1{
float:left;
font-size:17px;
}
#newsletter form{
float:right;
margin-top:15px;
}
#newsletter input[type="email"]{
padding:4px;
height:25px;
width: 250px;
}
/*boxes*/
#boxes{
margin-top: 20px;
}
#boxes .box{
float:left;
text-align: center;
width:33%;
padding:10px;
}
#boxes .box img{
width:30%;
}
/*side bar*/
aside#sidebar{
float:right;
width: 30%;
margin: 10px
}
/*main cal*/
article#main-col{
float:left;
width: 65%;
}
/*projects*/
ul#services li{
list-style: none;
padding: 20px;
boarder:#cccccc solid 1px;
margin-bottom:5px;
background:#e6e6e6;
}
div.gallery {
border: 1px solid #ccc;
float: left;
}
div.gallery:hover {
border: 1px solid #777;
}
div.gallery img {
width: 100%;
height: auto;
}
div.desc {
padding: 15px;
text-align: center;
}
* {
box-sizing: border-box;
}
.responsive {
padding: 0 6px;
float: left;
width: 33%;
}
.row {
margin: 8px -16px;
}
/* Add padding BETWEEN each column */
.row,
.row > .column {
padding: 8px;
}
/* Create four equal columns that floats next to each other */
.column {
float: left;
width: 33%;
}
/* Clear floats after rows */
.row:after {
content: "";
display: table;
clear: both;
}
#media only screen and (max-width: 700px) {
.responsive {
width: 49.99999%;
margin: 6px 0;
}
.column {
width: 49.9%;
margin: 6px 0;
}
}
#media only screen and (max-width: 500px) {
.responsive {
width: 100%;
}
.column {
width: 100%;
}
}
.clearfix:after {
content: "";
display: table;
clear: both;
}
/*people*/
ul#people li{
list-style: none;
padding: 20px;
boarder:#cccccc solid 1px;
margin-bottom:5px;
float: left;
background:#e6e6e6;
}
ul#people img{
float: left;
}
/*form*/
aside#sidebar .quote input, aside#sidebar .quote textarea {
width:90%;
padding: 5px;
}
/*footer*/
footer{
padding:20px;
margin-top:20px;
color:#ffffff;
background-color:#483D8B;
/* text-align: center;*/
}
.column1 {
float: left;
width: 50%;
margin-left:50px;
}
.column2 {
float; top;
float: right;
width: 50%;
margin-right:50px;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
.fa {
padding: 20px;
font-size: 30px;
text-align: center;
text-decoration: none;
margin: 2px 2px 2px 2px;
}
.fa:hover {
opacity: 0.7;
}
.fa-facebook {
background: #3B5998;
color: white;
}
.fa-linkedin {
background: #007bb5;
color: white;
}
.fa-youtube {
background: #bb0000;
color: white;
}
.fa-instagram {
background: #125688;
color: white;
}
.fa-android {
background: #a4c639;
color: white;
}
/*media quaeris*/
#media(max-width:768px){
header #branding, header nav , header li , #newsletter h1, #newsletter form, #boxes .box,
article#main-col, aside#sidebar
{
float:none;
text-align:center;
width:100%;
}
header {
padding-bottom: 15px;
}
#showcase{
background-size:768px;
}
#showcase h1{
margin-top:40px;
}
#newsletter button, .quote button{
display: block;
width: 100%;
}
#newsletter form input[type="email"], .quote input, .quote textarea{
margin-bottom: 5px;
width: 100%;
}
}
<header>
<div class="container">
<div id="branding">
<h1><span class="highlight">Fasma</span> Engineers</h1>
</div>
<nav>
<ul>
<li class="current">Home</li>
<li>About</li>
<li>Projects</li>
<li>People</li>
<li class="current2">|EN</li>
<li>GR|</li>
</ul>
</nav>
</div>
</header>
<section id="showcase">
<div class="container">
<h1>World Class Structural And Geotechnical Engineers</h1>
<p>Expienced With The Most Prestigious Projects</p>
</div>
</section>
<section id= "newsletter">
<div class="container">
<h1>Subsctibe to our NewsLetter</h1>
<form name="submit-to-google-sheet">
<input type="email" name="email" placeholder="Enter Email">
<button type="submit" class= "button_1">Subscribe</button>
</form>
</div>
</section>
You have to remove min-width: 500px; from style.css line 90.
and add
#media(min-width:500px){
#showcase{
min-width:500px;
}
}
So It will look like -
Convert your widths to use percentages if you want a really responsive layout.
header {
padding-bottom: 2%;
}
#showcase{
background-size:88%;
}
#showcase h1{
margin-top:5%;
}

How do I remove the margin on the bottom 2 divs on my basic HTML site?

Below is the code for my site. I am trying to figure out why there is right margin on the bottom two divs when .jumbotron has a width of 100%.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="main.css" rel="stylesheet"/>
<title>Vasilios Lambos</title>
</head>
<body>
<header role="banner">
<div id="fixed">
<nav role="navigation">
<ul>
<li>Home</li>
<li>Portfolio</li>
<li>Process</li>
<li>Contact</li>
</ul>
</nav>
</div>
</header>
<div class="jumbotron">
<img src="IMG_1677.jpg" width="200" height="200"/>
<h1>Vaslios Lambos</h1>
<p>Industrial and Interaction Designer</p>
<p>Always staying hungry to learn new and inspiring ways to improve my creative process. I utilize design thinking, research methods, and ethonography to explore user experience and services. Core hard skills consist of user interface design, product rendering, and testing.</p>
</div>
<div class="pics">
<img src="VL-Logo.png" width="200" height="200"/>
</div>
<div class="info">
<div class="container">
<h3>Overview</h3>
<p> ### </p>
</div>
</div>
<div class="footer">
<h3>Soft & Hard skills</h3>
<ul>
<li>Adobe Suite</li>
<li>Axure RP</li>
<li>HTML/CSS/Javascript</li>
</ul>
</div>
</body>
</html>
Notice the CSS where jumbotron in 100% and both info div and footer have margin on the right when previewed in the browser.
#charset "UTF-8";
#font-face {
font-family: Verdana, Geneva, sans-serif;
}
body {
font-family:Verdana, Geneva, sans-serif;
background-color: #FFF;
}
*{margin:0;padding:0;}
#fixed ul{
position:fixed;
top:0px;
width:100%;
z-index:9999;
list-style-type:none;
margin: 0;
padding: 0;
overflow:hidden;
background-color: #FFF;
}
nav li{
float:left;
}
nav li a{
display:block;
color: #000;
font-size: 11px;
font-weight: bold;
padding:20px;
text-transform:uppercase;
text-decoration:none;
}
nav a:hover {
background-color: orange;
}
div.jumbotron {
margin-top:80px;
margin-left:auto;
margin-right:auto;
padding:10px;
height:500px;
width:100%;
color:white;
text-align:center;
background-color:#000
}
.jumbotron p{
width:500px;
margin-left:inherit;
margin-right:inherit;
}
.jumbotron img {
border-radius: 50%;
}
.pics{
display:inline;
height:232px;
width:232px;
padding:0;
margin:0;
}
.pics img{
padding:15px;
border:1px solid #ccc;
background-color: #eee;
width:200px;
height:200px;
}
div.info {
background-color: #000;
color:white;
padding:20px;
height:400px;
}
div.footer{
background-color:#000;
color:white;
clear:both;
height:400px;
padding:20px;
}
HTML is ok
Here is the PEN
CSS followed by /* -------------- ADDED */ is the change
Here is the CSS
#font-face {
font-family: Verdana, Geneva, sans-serif;
}
body {
font-family: Verdana, Geneva, sans-serif;
background-color: #FFF;
}
* {
margin: 0;
padding: 0;
}
#fixed ul {
position: fixed;
top: 0px;
width: 100%;
z-index: 9999;
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #FFF;
}
nav li {
float: left;
}
nav li a {
display: block;
color: #000;
font-size: 11px;
font-weight: bold;
padding: 20px;
text-transform: uppercase;
text-decoration: none;
}
nav a:hover {
background-color: orange;
}
div.jumbotron {
margin-top: 80px;
margin-left: auto;
margin-right: auto;
padding: 10px;
height: 500px;
width: 100%;
color: white;
text-align: center;
background-color: #000;
box-sizing: border-box; -------------- ADDED */
}
.jumbotron p {
width: 500px;
margin-left: inherit;
margin-right: inherit;
}
.jumbotron img {
border-radius: 50%;
}
.pics {
display: inline;
height: 232px;
width: 232px;
padding: 0;
margin: 0;
}
.pics img {
padding: 15px;
border: 1px solid #ccc;
background-color: #eee;
width: 200px;
height: 200px;
}
div.info {
background-color: #000;
color: white;
padding: 20px;
height: 400px;
width: 100%; /* ------------ ADDED */
box-sizing: border-box; /* -------------- ADDED */
}
div.footer {
background-color: #000;
color: white;
clear: both;
height: 400px;
padding: 20px;
width: 100%; /* -------------- ADDED */
box-sizing: border-box; /* -------------- ADDED */
}

Display Logo inline with menu items in HTML and CSS

I am trying to display logo at top end in HTML and CSS.
However, the logo image size is not reduced to the specified width and height and I do not see it being overridden anywhere else.
Code is as follows:
/*********************************************************************************/
/* Banner */
/*********************************************************************************/
#banner
{
overflow: hidden;
height: 300px;
position: relative;
background: url(images/pic01.jpg) no-repeat center;
background-size: cover;
}
#banner .image
{
}
#banner p{
position: absolute;
top:30%;
left: 40%;
width: 100px;
padding: 5px;
margin: 5px;
font-family: 'Lobster', cursive;
font-weight: bold;
font-size: 55px;
color: #fff;
}
/** MENU */
#menu-wrapper
{
background: #16a085;
overflow:auto;
}
#menu {
overflow: hidden;
height: 100px;
float:left;
}
#menu ul {
margin: 0;
padding: 0px 0px 0px 0px;
list-style: none;
line-height: normal;
text-align: center;
}
#menu li {
display: inline-block;
}
#menu a {
display: block;
letter-spacing: 1px;
padding: 0px 40px;
text-decoration: none;
text-align: center;
text-transform: uppercase;
font-size: 0.80em;
line-height: 100px;
border: none;
color: #FFF;
}
#menu a:hover, #menu .current_page_item a {
text-decoration: none;
}
#menu .current_page_item a {
background: #1abc9c;
}
#Logo{
width:10px;
height:30px;
float: left;
margin-top: 5px;
}
<div id="wrapper">
<div id="menu-wrapper">
<div id = "Logo" >
<img src="images/Logo.jpg" ></img>
</div>
<div id="menu" class="container">
<ul>
<li class="current_page_item">Homepage</li>
<li>About</li>
<li>Blog</li>
<li>Portfolio</li>
<li>Contact</li>
</ul>
</div>
/*and so on */
</div>
It looks like this:
White part in the banner is image that is taking up the width despite of having set width attribute to 10 px.
In your CSS. change the style for #Logo to #Logo img{}. you have to set the width to img tag. Not its parent container.
#Logo img{
width:100px;
height:30px;
float: left;
margin-top: 5px;
}
JS Fiddle

Trying to get my footer to go to the bottom

MY GOAL:
Center footer nav at bottom of white space on page.
Hey guys I'm trying to get my footer to move to the bottom of the page. I have the navigation and image showing up properly, but the footer wants to stay near the top.
The trouble I had before was getting the navigation to show up at the top to the right of the logo in all browsers, now that I've fixed that i just need this footer to stay centered at the bottom.
Here is the code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style type="text/css">
...
</style>
<link href="style2.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="bg">
<img style="display:block;" src="http://cdn-ci53.actonsoftware.com/acton/attachment/8908/f-0015/1/-/-/-/-/Background_Gradient.png">
</div>
<div id="main">
<div id="header">
<div id="top-left"><img src="http://cdn-ci53.actonsoftware.com/acton/attachment/8908/f-0019/1/-/-/-/-/Medata%20With%20Sub%20550x131.png" atl="Logo" class="logo" alt="Visit Medata Home Page">
</div>
<div id="nav">
<ul>
<li>NewsWorthy</li>
<li>Solutions</li>
<li>About Us</li>
<li>Home</li>
</ul>
</div>
</div>
<div id="acton">
</div>
<div id="footer">
<ul>
<li>NewsWorthy</li>
<li>Solutions</li>
<li>About Us</li>
<li>Home</li>
</ul>
</div>
</div>
</body>
</html>
Here is the CSS
//!--My Custom CSS--!//
body {
margin:0; padding:0;
}
html, body, #bg {
height:100%;
width:100%;
}
#bg {
position:absolute;
left:0;
right:0;
bottom:0;
top:0;
overflow: hidden;
background-repeat: inherit;
z-index:-1;
padding-bottom: 25px;
}
#bg img {
width:100%;
min-width:100%;
min-height:100%;
}
#content {
z-index:1;
overflow: auto;
}
#main
{
margin: auto !important;
visibility: visible !important;
-webkit-border-radius: 5px !important;
-webkit-box-shadow: 0px 0px 20px #000 !important;
-webkit-box-sizing: content-box !important;
-moz-box-shadow: 0px 0px 20px #000 !important;
box-shadow: 0px 0px 20px #000 !important;
background-color: #fff;
width: 900px;
margin-left: auto;
margin-right: auto;
}
#top-left {
float: left;
display: block;
}
#top-left img {
height: 73px;
width: 329px;
padding-left: 20px;
padding-top: 20px;
}
#nav {
margin: 0;
padding: auto;
}
#nav ul {
display: table-row;
float: right;
}
#nav li {
background: #043d70;
color: white !important;
padding: 8px 20px;
display: inline;
border-radius: 3px;
font-family: Tahoma, Geneva, sans-serif;
text-transform: uppercase;
font-weight: 600;
font-size: 12px;
margin: 20px 8px 0px 0px;
text-align: center;
float: right;
}
#nav li:hover {
text-decoration: none;
background: #43434A;
}
#nav li a {
color: #fff;
font-size: 12px;
font-family: Tahoma, Geneva, sans-serif;
text-decoration: none;
}
#main {
height: 100%;
}
#footer {
width: 100%;
height: 100%;
display: table-row;
}
#footer ul {
display: block;
position: absolute;
clear: both;
}
#footer li {
background: #043d70;
color: white !important;
padding: 8px 20px;
display: inline;
border-radius: 3px;
font-family: Tahoma, Geneva, sans-serif;
text-transform: uppercase;
font-weight: 600;
font-size: 10px;
margin: 20px 8px 0px 0px;
text-align: center;
}
#footer li:hover {
text-decoration: none;
background: #43434A;
}
#footer li a {
color: #fff;
font-size: 12px;
font-family: Tahoma, Geneva, sans-serif;
text-decoration: none;
}
//!--End My Custom CSS --! //
I think this is what you want
http://jsfiddle.net/hsh5c/
#footer {
height: 50px;
position:absolute;
bottom:0px;
left:0px;
width:100%;
}
#footer ul {
position:relative;
width: 400px;
margin-left:-200px;
left:50%;
}

Unwanted horizontal scroll bar

I'm having a bit of a problem. For some reason a horizontal scroll bar keeps appearing from my code. I've tried everything but I can't seem to remove it. The following link is a live preview of the code.
http://jsfiddle.net/y5x7V/
HTML
<body>
<section class="contain">
<div id="section-nav" class="section-nav">
<div class="top">
<ul>
<li class="logo">Magna Contra</li>
<li class="active">Blog With Us</li>
<li>Compxta</li>
<li>Laurie</li>
<li>SUBTITLESOFLIFE</li>
</ul>
</div>
</div>
</section>
<div class="bg">
<h1>SUBTITLESOFLIFE</h1>
</div>
<ul class="check">
<li class="bold">Hot Trends</li>
<li class="topic">Daft Punk</li>
<li class="topic">#bbcqt</li>
<li class="topic">Petite Noir - Major</li>
<li class="topic">Alt J Album Teaser</li>
<li class="topic">Materialistic Happine$$</li>
<li class="topic">WOLF</li>
</ul>
<div class="contar">
Lorem Dosi
</div>
</body>
</html>
CSS
ul
{
list-style-type:none;
margin:0;
padding:0;
text-align: center;
}
.check{
list-style-type:none;
margin:0;
padding:0;
text-align: center;
padding-top: 10px;
padding-bottom: 10px;
width: 100%;
display: inline-block;
}
::selection{background:red;color:red;}::-moz-selection{background:red;color:red;}
li
{
display: inline;
padding:15px;
text-align: center;
margin:auto 0;
position: relative;
}
li a{
text-decoration: none;
color:#bbbbbb;
font-family: "proxima-nova",sans-serif;
text-transform: uppercase;
text-align: center;
font-size: 0.78em;
letter-spacing: .2em}
hr{
color:#dfe0db;
border: 0;
background-color: #dfe0db;
height: 1px;
}
.bold{
display: inline;
}
.bold a{
color:#e94378;
}
.topic{
display: inline;
padding:8px;
text-align: center;
margin:auto 0;
position: relative;
}
.topic a{
-webkit-transition:400ms;-moz-transition:400ms;-o-transition:400ms;transition:400ms;color:#bbb;font-weight:700;outline:0;text-decoration:none}
.topic a:hover{
color:#e94378;text-decoration:none}
}
.logo a{
color:#bbb;
font-size: 0.78em;
text-decoration: none;
text-transform: uppercase;
}
img#hv {
filter: url(filters.svg#grayscale); /* Firefox 3.5+ */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(1); /* Google Chrome & Safari 6+ */
}
img#hv:hover {
filter: none;
-webkit-filter: grayscale(0);
}
.image {position: relative; text-align: center;width:100%;height:75%;}
.image span {position: absolute; line-height: 20px; display: block; top: 50%;
margin-top: -10px; width: 100%; color: white;font-family: "proxima-nova";
text-transform: uppercase;
font-size: 1.5em; letter-spacing:;}
#media screen and (max-width:800px) {
.image span {
font-size:0.8em;
}
}
#media screen and (max-width:400px) {
.image span {
font-size:0.7em;
}
}
.bg{
background-color: #e94378;
}
img.ri
{
position: relative;
max-width: 100%;
width:100%;
display: inline-block;
vertical-align: middle;
}
#media screen and (orientation: portrait) {
img.ri { max-width: 100%; }
}
#media screen and (orientation: landscape) {
img.ri { max-height: 100%; }
}
.text{
font-family: "proxima-nova";
font-size: 1em;
letter-spacing: .2em;
text-transform: uppercase;
background-color: #e94378;
padding:20px;
color:yellow;
position: absolute;
left:200px;
bottom:50px;
}
.tex{
font-family: "proxima-nova",sans-serif;
font-size: 2.5em;
letter-spacing: 3px;
text-transform: uppercase;
bottom:160px;
left: 320px;
color:white;
padding: 10px;
}
.image{
vertical-align: middle;
}
.logo a:hover{
color:white;
}
.active a{
color:white;
}
.contain{
display: table;
width: 100%;
text-align: center;
margin: 0 auto;
}
.block {
display: table-row;
height: 1px;
}
.navigation {
display: inline-block;
padding: 10px;
width:100%;
margin: auto;
height: 150px;
}
.top {
background-color: #444;
width:100%;
display: inline-block;
padding: 10px;
text-align: center;
}
.navigation:nth-child(odd) {
background: #222;
}
.push {
height: auto;
}
.contar {
margin: 0 auto;
text-align: center;
width:100%;
height:400px;
background-color: white;
}
img.ft{
float:left;
}
.featured{
background-color: white;
width:69%;
text-align: center;
margin: 0 auto;
display: inline-block;;
}
.block:nth-child(odd) {
background: #fff;
}
.search {
border:0px;
background-color:transparent;
color:white;
display: inline-block;
height:28px;
}
.section-nav a{-webkit-transition:400ms;-moz-transition:400ms;-o-transition:400ms;transition:400ms;color:#bbb;font-weight:700;outline:0;text-decoration:none;}
.section-nav a.active,.section-nav a:hover{color:#fff;text-decoration:none}
h1{
font: 800 1em "proxima-nova", sans-serif;
font-size:3.125em;
text-align:center;
padding:10px 10px;
margin:20px 20px;
background-color:;
position: relative;
text-decoration:none;
display:inline-block;
letter-spacing: 6px;
color:yellow;}
h1 a{
text-decoration: none;
letter-spacing: 8px;
padding-left: 0.15em;
color:#a8a820;
}
.txt{
font:800 proxima-nova;
}
h2{
font: 800 1em "proxima-nova", sans-serif;
font-size:3.125em;
text-align:center;
padding:10px 10px;
margin:20px 20px;
background-color:;
position: relative;
text-decoration:none;
display:inline-block;
letter-spacing: 6px;
color:yellow;}
h2 a{
text-decoration: none;
letter-spacing: 8px;
padding-left: 0.15em;
color:#a8a820;
}
Don't use overflow-x: hidden - it only papers over the cracks, it doesn't fix the issue. You can fix it by using the box-sizing property on the top div:
.top {
background-color: #444;
width:100%;
display: inline-block;
padding: 10px;
text-align: center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
This takes your padding: 10px into account when applying 100% width.
You can also use a polyfill to check for browser support, using the Modernizr plugin.
add
overflow-x:hidden
to the main wrapper class
This is because you're combining both 100% width and padding. If 100% width evaluates to 100px, for example, adding 5px padding to the left and right on top of that will cause your element to have an overall width of 110px. You can get around this by changing the element's box-sizing.
.bottom, .top {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
JSFiddle demo.
You can set overflow-x in body to hidden
http://jsfiddle.net/y5x7V/1/
body {
line-height: 1;
text-align: center;
overflow-x: hidden;
}
You can fix this correctly rather than hacking in some CSS to hide the scrollbar by fixing the top class in your CSS. Set the padding to 0 (as it's taking the full width of the parent) by adding:
padding:0;
to .top
JSFiddle
You can set the padding's height property to get the original look, this is just a quick fix to demo why it's breaking.
Change
.top {padding:10px;}
to
.top {padding:10px 0; }
Line 261 of css you provided, change from padding: 10px;, to padding: 10px 0;.