After researching this topic a bit, I've found that this is a fairly common question to ask, but a solution varies depending on the theme. I contact my theme's developers, but have not received a response.
I've looked through my theme's CSS and haven't been able to find how or where to get rid of this white space gap between the body content and my footer.
Here is a screenshot of the issue. (Please note: this is a screenshot of a preview; it isn't actually live). My website is: https://dental.keystoneindustries.com/
Is there a line of CSS I need to edit/remove/add? If so, where? CSS posted below.
#languageSelector {
display: none;
}
/*Language selector*/
div#all-site-wrapper.hfeed.site div.OneLinkShow.OneLinkKeepLinks {
position: absolute;
width: 100%;
left: auto;
right: auto;
z-index: 100000;
}
div#all-site-wrapper.hfeed.site div.OneLinkShow.OneLinkKeepLinks p {
max-width: 1170px;
width: auto;
padding: 15px 15px 0;
margin-left: auto;
margin-right: auto;
}
.wpr_hazzard_img {
width: auto !important;
display: block;
}
.wpr_hazzard_img_inline {
width: auto !important;
display: inline-block !important;
}
.wpr_message_box {
display: inline-block;
margin: 0 1em 1em 0;
padding: 0 20px;
vertical-align: top;
background: #fff none repeat scroll 0 0;
border: 3px solid black;
border-radius: 0;
color: black;
}
.group_table .woocommerce .quantity, .woocommerce-page .quantity{
width: 50px !important;
display: inline-block;
float: left !important;
}
.group_table .wpr_tooltip_js{
display: inline-block;
margin-top: 10px;
vertical-align: middle;
}
#all-site-wrapper .iv-layout.header .login-ajax .trigger {
font-size: 13px;
}
.header-right-area {
margin-top:12px;
}
.live-search .iv-layout.header .inner-form {
padding: 14px;
}
.live-search {
position: relative;
}
.live-search .trigger {
display: none;
}
.live-search .inner-wrapper {
visibility: visible;
opacity: 1;
position: static;
}
#all-site-wrapper .live-search:not(.search-top-style):not(.search-full-screen- alt-style):not(.search-full-screen-style) .inner-wrapper:after,
#all-site-wrapper .live-search:not(.search-top-style):not(.search-full-screen- alt-style):not(.search-full-screen-style) .inner-wrapper:before {
display: none;
}
.live-search .inner-wrapper {
width: 260px;
border: 0 none;
}
#all-site-wrapper .live-search .inner-form {
padding: 0;
}
.classic-right-area .wpr-fix .iv-module {
margin-left: 10px;
}
#media (max-width: 1200px) {
.classic-right-area {
min-height: 200px;
}
.classic-right-area .header-right-area {
position: relative;
}
#all-site-wrapper .classic-right-area .wpr-fix .iv-module {
padding-bottom: 20px;
}
#all-site-wrapper .wpr-fix {
width: auto;
}
#all-site-wrapper .login-ajax {
margin-top: 10px;
}
#all-site-wrapper .woo-cart {
margin-top: 4px;
}
}
#media (max-width: 992px) {
#all-site-wrapper .wpr-fix .iv-module {
display: block;
}
#all-site-wrapper .wpr-fix {
position: relative;
width: 100%;
}
#all-site-wrapper .login-ajax .inner-wrapper {
left: 0;
}
#all-site-wrapper .login-ajax .inner-wrapper:before {
left: 31px;
}
#all-site-wrapper .login-ajax .inner-wrapper:after {
left: 32px;
}
#all-site-wrapper .classic-right-area .custom-text {
display: none !important;
}
#all-site-wrapper .wpr-fix .live-search {
position: absolute;
top: 0;
left: 20px;
margin-left: 0;
}
}
#media (max-width: 767px) {
.wpr-spacer {
height: 130px;
width: 100%;
float: left;
}
#all-site-wrapper .wpr-fix .live-search {
margin: 0 auto !important;
position: static;
float: none;
}
#all-site-wrapper .wpr-fix .login-ajax {
position: absolute;
top: 20px;
left: 25%;
width: 200px;
}
#all-site-wrapper .wpr-fix .woo-cart {
position: absolute;
left: 41%;
top: 20px;
width: 250px;
}
#all-site-wrapper .logo img {
margin-top: 0px;
}
#all-site-wrapper .header-left-area {
display: inline-block;
float: none;
position: relative;
left: 24%;
}
#all-site-wrapper .header-left-area .logo {
margin: 35px 0 0px;
}
#all-site-wrapper .live-search .inner-form {
margin-top: -46px;
}
}
#media (max-width: 600px) {
#all-site-wrapper .wpr-fix .login-ajax {
left: 22%;
}
}
#media (max-width: 478px) {
#all-site-wrapper .wpr-fix .login-ajax {
left: 0;
width: 80px;
}
#all-site-wrapper .wpr-fix .woo-cart {
left: 24%;
width: auto;
}
#all-site-wrapper .classic-right-area .wpr-fix .iv-module.live-search {
padding-bottom: 0;
position: absolute;
right: 15px;
bottom: 15%;
left: auto;
top: auto;
}
.live-search .inner-wrapper {
width: 170px;
border: 0 none;
}
.wpr-spacer {
height: 80px;
width: 100%;
float: left;
}
.wpr-fix {
margin-top: 0;
}
div#all-site-wrapper.hfeed.site div.OneLinkShow.OneLinkKeepLinks p {
margin-bottom: 10px;
padding: 15px;
}
#all-site-wrapper .header-left-area .logo {
margin: 5px 0 0;
}
.classic-right-area .menu-area-wrapper {
border-top: 0;
border-bottom: 0;
position: absolute;
top: 0;
right: 0;
}
.classic-right-area {
min-height: 130px;
}
.classic-right-area.stuck {
min-height: inherit;
}
.classic-right-area.stuck .container {
display: block !important;
}
.classic-right-area.stuck .container .header-left-area .logo {
margin: 15px auto !important;
}
.classic-right-area.stuck .container .header-left-area .logo .logo-normal {
margin: 0 auto;
}
.classic-right-area.stuck .container .wpr-fix {
display: none;
}
}
Any help would be much appreciated!
You have elements with the class .ivan-custom-wrapper which have a margin-bottom: 45px; which is causing the white space. Either remove that margin completely or change it to a margin-top and then zero out the margin on the first instance of that element.
Related
I am trying to fix a CSS created by someone else(I took over a job from a other company for my current client)
As for now everything working in my website except on my Samsung Galaxy S8. The footer doesnt follow the rules. I have putted everything I could find online with
#media only screen and (min-width: 360px) and (max-width: 767px) {
/* Your Styles... */
}
But still when I'm going on the website on my S8. The text in a specific part that I want to follow rules..doesnt. (Part is Footer-right2)
On iPad, Desktop its working except this.
Any ideas ?
Here my CSS :
#media and (min-width: 360px) and (max-width: 767px) {
#footer .footer-wrapper .footer-right2 {
text-align: center;
font-size: 0.5em;
font-weight: 300;
padding-left: 15px;
margin:auto;
max-width:200px;
}
#footer .footer-logo {
display: inline-block;
padding-left: 15px;
margin:auto; } }
It's working for other size so here one of them as exemple :
#media (max-width: 768px) {
#header .header-wrapper {
height: 85px; }
#header .header-toggle-menu {
position: fixed;
top: 30px;
right: 15px;
z-index: 7000;
display: block; }
#header .header-toggle-menu span {
display: block;
width: 42px;
height: 7px;
border-radius: 3px;
background-color: #1d1d1d;
transition: background-color 0.175s linear; }
#header .header-toggle-menu span + span {
margin-top: 4px; }
#header .header-menu {
position: fixed;
right: 0;
top: 0;
bottom: 0;
z-index: 6000;
padding: 7px;
width: 300px;
background-color: #08ab0f;
padding-top: 85px;
transform: translateX(300px);
transition: transform 0.225s ease-in-out; }
#header .header-menu a {
display: block;
padding: 7px;
font-size: 0.85em;
font-weight: 900;
color: #ffffff;
transition: none;
background-color: #e13649;
margin-bottom: 7px; }
#header .header-menu a:hover, #header .header-menu a:focus {
color: #ffffff; }
#header.active .header-menu {
transform: translateX(0); }
#header.active .header-toggle-menu span {
background-color: #ffffff; }
#footer .footer-wrapper .form-message {
top: 85px; }
#footer .footer-wrapper .footer-right2 {
text-align: center;
font-size: 0.5em;
font-weight: 300;
padding-left: 15px;
margin:auto;
max-width:200px;
}
#footer .footer-logo {
display: inline-block;
padding-left: 15px;
margin:auto; }
#page {
padding-top: 85px; }
.slider-container {
height: 530px;
background-color: #08ab0f; }
.slider-container .slider-slides {
height: 500px; }
.slider-container .slider-slides .slides-item {
position: relative; }
.slider-container .slider-slides .slides-item .item-left, .slider-container .slider-slides .slides-item .item-right {
position: absolute;
top: 0;
left: 0;
right: auto;
width: 100%;
height: 100%; }
.slider-container .slider-slides .slides-item .item-left {
z-index: 100;
background-color: rgba(0, 0, 0, 0.3);
text-align: center; }
.slider-container .slider-slides .slides-item .item-right {
z-index: 50; }
.slider-container .slider-navigation {
position: absolute;
bottom: 0; }
.single-team_member .team-member-header {
display: block;
align-items: stretch;
justify-content: center;
flex-direction: column;
flex-wrap: nowrap; }
.single-team_member .team-member-header .header-image {
padding: 0; }
.single-team_member .team-member-header .header-image:before {
content: '';
display: block;
padding-bottom: 56.75%; }
.single-team_member .team-member-header .header-content {
background-color: #1d1d1d;
padding: 30px 15px; } }
I'm having a strange CSS problem where the main div container on my website shifts to the right when I visit certain pages. This happens even though there is no specific CSS rule to move it
I've uploaded a temp version of my site here:
http://myawesometestsite.ddns.net/
When you go to the Publications and Contact page the entire container shifts to the right by a few pixels. The position appears to be correct and unshifted on all other pages
This is the full CSS I'm using:
body {
background-color: #dcd8cf;
font-family: Raleway, Arial, sans-serif;
font-size: 1em;
}
h1 {
font-size: 1.5em;
color: #832C00;
margin-bottom: 30px;
}
h2 {
font-size: 1.2em;
color: #832C00;
margin-top: 30px;
}
h3 {
font-size: 1em;
margin-bottom: 5px;
margin-top: 20px;
}
h4 {
font-size: 1em;
font-style: italic;
margin-top: 0px;
margin-left: 10px;
margin-bottom: 5px;
}
.container {
position: relative;
left: 50%;
margin-left: -470px;
width: 940px;
border: 1px solid black;
}
/*
Header
*/
header {
position: relative;
display: inline-block;
width: 100%;
height: 180px;
background-color: #a63700;
}
header h1 {
position: absolute;
font-size: 2.5em;
color: #e6e6dc;
top: 50px;
left: 100px;
margin: 0px;
}
header h2 {
position: absolute;
font-size: 0.77em;
color: #e6e6dc;
top: 100px;
left: 100px;
margin: 0px;
opacity: 0.7;
}
header img {
border: 2px solid #e6e6dc;
border-radius: 50%;
max-width: 100%;
max-height: 100%;
}
.profileImage {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 10px;
max-width: 150px;
max-height: 150px;
}
.skillIcons {
position: absolute;
right: 25px;
top: 15px;
}
.skillIcons img {
display: inline;
width: 75px;
height: 75px;
padding: 5px;
margin: 15px;
opacity: 0.7;
}
/*
Navigation menu
*/
nav {
position: relative;
z-index: 1;
text-align: center;
letter-spacing: 2px;
background-color: #a63700;
height: 50px;
width: 100%;
}
nav a {
position: relative;
top: 20px;
color: #D1D1C9;
text-decoration: none;
padding: 0 30px;
}
nav a:hover {
border-bottom: solid 1px #e6e6dc;
padding-bottom: 3px;
}
.navSelected {
text-shadow:0px 0px 1px white;
color: white;
}
/*
Main content
*/
main {
position: relative;
background-color: white;
padding: 10px;
}
/*
Footer
*/
footer {
position: relative;
color: #e6e6dc;
background-color: #a63700;
font-size: 10pt;
padding: 10px;
}
.leftFooter ul {
padding-left: 0px;
}
.leftFooter li {
display: inline;
list-style-type: none;
}
.leftFooter li a {
color: #e6e6dc;
text-decoration: none;
}
.leftFooter li + li:before {
color: #e6e6dc;
content: "|";
padding: 10px;
}
.rightFooter {
position: absolute;
right: 10px;
top: 4px;
}
.rightFooter img {
display: inline;
max-width: 30px;
max-height: 30px;
vertical-align: middle;
margin-top: -3px;
}
.copyright {
font-size: 1em;
}
/*
Home page
*/
/*
Publications page
*/
.hangingIndent {
padding-left: 1.5em;
text-indent:-1.5em;
}
.publications h2 {
margin-top: 50px;
}
/*
Code page
*/
.codeProjects a {
color: #a63700;
text-decoration: none;
}
.codeProjects a:hover {
text-decoration: underline;
}
.codeProjects p {
margin-left: 10px;
}
/*
CV page
*/
.cvContainer {
width: 90%;
margin: 0 auto;
}
.cvEntry {
margin-bottom: 30px;
margin-left: 20px;
margin-right: 20px;
}
.sectionHeading {
width: 100%;
border-bottom: 1px solid #000;
}
.alignLeft {
display: block;
float: left;
text-align: left;
width: 80%;
margin-top: 10px;
}
.alignLeft p {
font-size: 1em;
}
.alignLeftSub {
margin-top: -10px;
margin-left: 20px;
}
.alignRight {
display: block;
float: right;
text-align: right;
width: 20%;
margin-top: 10px;
}
.clear {
clear: both;
}
/*
Contact page
*/
.contactInfo {
margin-left: 20px;
}
.contactInfo img {
display: inline;
max-width: 30px;
max-height: 30px;
vertical-align: middle;
}
.emailHidden {
display: none;
}
.contactInfo a {
margin-left: 5px;
color: #a63700;
text-decoration: none;
}
.contactInfo #emailAddress {
margin-left: 2px;
}
.contactInfo #emailAddress a {
margin-left: 8px;
}
/*
Media queries
*/
#media screen and (max-width : 940px) {
.container {
position: relative;
left: 0px;
margin: 0px;
width: 100%;
}
header h1 {
left: 5%;
margin: 0px;
}
header h2 {
left: 5%;
margin: 0px;
}
.skillIcons img {
max-width: 70px;
max-height: 70px;
margin-left: 5px;
margin-right: 0px;
}
}
#media screen and (max-width : 800px) {
header h1 {
display: none;
}
header h2 {
display: none;
}
.skillIcons img {
display: none;
}
nav {
height: 150px;
}
nav a {
display: block;
}
nav a:hover {
border-bottom: none;
padding-bottom: 0px;
}
}
#media screen and (max-width : 600px) {
.rightFooter {
position: relative;
display: block;
margin-left: 10px;
}
}
I don't believe there's anything in here that's causing the container to shift for just those 2 pages but maybe I'm missing something. Anyone have any idea whats causing this?
Add "overflow-y: scroll;" to your "body" selector. It should look like this in your CSS:
body {
background-color: #dcd8cf;
font-family: Raleway, Arial, sans-serif;
font-size: 1em;
overflow-y: scroll;
}
The lenght of the pages create a vertical scroll bar. Publication and contact are small then the other are more big then the screen. for fix this you need an overflow-y set to scroll;
body {
overflow-y: scroll;
}
How can I center align the logo on this header? Also wanted to know how to enable background transparency for header background color and change the value for maximum size for the logo. Here is the CSS entry for the header section.
#header {
display: block;
position: relative;
z-index: 600;
/* Higher than the sidebar widget and widget container, sliders */
margin: 0;
padding: 0;
width: 100%;
background: #2F2E3C; }
#header > .inner {
position: relative; }
#header > .inner > .wrap {
position: relative;
min-height: 76px; }
#media only screen and (max-width: 1024px) {
#header > .inner > .warp {
min-height: 80px; } }
#media only screen and (max-width: 767px) {
#header > .inner {
text-align: center; }
#header > .inner > .wrap {
min-height: 40px; } }
#header.sticky {
position: fixed;
z-index: 999;
width: 100%; }
#media only screen and (max-width: 767px) {
#header.sticky {
position: static !important; } }
#header.sticky .wrap {
min-height: 0; }
.boxed #header.sticky {
max-width: 1180px;
width: 96%; }
.admin-bar #header.sticky {
top: 32px; }
#header.sticky #site-logo {
top: 10px; }
#header.sticky .dropdown-menu-wrap > ul.menu > li > ul.sub-menu {
top: 60px; }
#header.sticky #primary-menu > ul.menu > li > a {
line-height: 60px; }
#header.sticky #top-header-area {
display: none; }
#site-logo {
position: relative;
display: inline-block;
float: left;
left: 0;
top: 30px;
line-height: 0;
margin: 0; }
#site-logo a {
font-size: 28px;
color: #494D4E;
line-height: 36px;
direction: ltr;
display: block;
text-align: left;
/* Do not let logo get bigger than the header */
font-family: "Lato", Arial, Helvetica, Verdana, sans-serif; }
#media only screen and (max-width: 767px) {
#site-logo a {
display: inline-block;
text-align: center; } }
#site-logo a img {
max-height: 100%;
max-width: 100%; }
#media only screen and (max-width: 767px) {
#site-logo {
display: block;
float: none;
position: relative;
margin: 0 auto;
top: 0;
padding: 10px 0; }
#site-logo a img {
max-width: 75%;
margin: 0 auto; } }
#site-description {
margin: 0; }
#container {
background: #f7f7f7;
Edit:
#header {
display: block;
position: relative;
z-index: 600;
/* Higher than the sidebar widget and widget container, sliders */
margin: 0;
padding: 0;
width: 100%;
background: #2F2E3C; }
#header > .inner {
position: relative; }
#header > .inner > .wrap {
position: relative;
min-height: 76px; }
#media only screen and (max-width: 1024px) {
#header > .inner > .warp {
min-height: 80px; } }
#media only screen and (max-width: 767px) {
#header > .inner {
text-align: center; }
#header > .inner > .wrap {
min-height: 40px; } }
#header.sticky {
position: fixed;
z-index: 999;
width: 100%; }
#media only screen and (max-width: 767px) {
#header.sticky {
position: static !important; } }
#header.sticky .wrap {
min-height: 0; }
.boxed #header.sticky {
max-width: 1180px;
width: 96%; }
.admin-bar #header.sticky {
top: 32px; }
#header.sticky #site-logo {
top: 10px; }
#header.sticky .dropdown-menu-wrap > ul.menu > li > ul.sub-menu {
top: 60px; }
#header.sticky #primary-menu > ul.menu > li > a {
line-height: 60px; }
#header.sticky #top-header-area {
display: none; }
#site-logo {
position: relative;
float: left;
left: 0;
top: 30px;
line-height: 0;
margin: 0; }
#site-logo a {
font-size: 28px;
color: #494D4E;
line-height: 36px;
direction: ltr;
display: block;
text-align: left;
/* Do not let logo get bigger than the header */
font-family: "Lato", Arial, Helvetica, Verdana, sans-serif; }
#media only screen and (max-width: 767px) {
#site-logo a {
display: inline-block;
text-align: center; } }
#site-logo a img {
margin:auto;
max-height: 100%;
max-width: 100%; }
#media only screen and (max-width: 767px) {
#site-logo {
display: block;
float: none;
position: relative;
margin: 0 auto;
top: 0;
padding: 10px 0; }
#site-logo a img {
max-width: 75%;
margin: 0 auto; } }
#site-description {
margin: 0; }
#container {
background: #f7f7f7; }
Remove display: inline-block; from #site-logo then add margin:auto; to #site-logo a img.
Edit: I also noticed you have float:center; in #site-logo which is not a valid property, so I would consider removing it as it is redundant.
The mobile page works just like i wanted it to work but the problem is when i open site navigation, main contect is sliding down and navigation is static. i cant scroll navigation.. is it anyway that i could scroll navigation only? the site where is problem is www.budivelik.hr any idea?
body > .main-nav {
position: fixed;
top: 0;
left: -210px;
bottom: 0;
height: 100%;
padding-top: 80px;
margin-top: 0;
width: 210px;
z-index: 101;
background: #333333;
overflow: hidden;
-webkit-box-shadow: inset 0 0 30px rgba(0,0,0,0.4);
box-shadow: inset 0 0 30px rgba(0,0,0,0.4);
z-index: 150;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.main-nav.active-menu {
left: 0;
}
.main-header .nav-bar {
display: block;
}
body.menu-effect .boxed-view {
-webkit-transition: all 0.4s ease;
-webkit-transform: translate(200px,0);
z-index: 100;
position: relative;
}
body > .main-nav > ul,
body > .main-nav > ul > li {
float: none;
}
body > .main-nav > ul > li > a {
display: block;
background: rgba(0,0,0,0.3);
padding: 20px 11px 18px;
margin-left: 0;
margin-right: 0;
border-bottom-color: rgba(255,255,255,0.1);
}
body .mobile-menu-button {
display: block;
width: 62px;
height: 62px;
margin: auto;
padding: 1px 5px;
font-size: 24px;
position: absolute;
right: 76px;
top: 0;
bottom: 0px;
margin: auto;
text-align: center;
line-height: 62px;
background: url("../images/icons/menu-icon.png") no-repeat 0 0 transparent;
}
body .woocommerce-page .mobile-menu-button{
background: url("../images/icons/white-menu-icon.png") no-repeat 0 0 transparent;
background-size: cover;
right: 132px;
}
.mobile-menu-button:hover {
text-decoration: none;
}
.product .summary{
padding: 0 20px;
}
.main-header .socials{
margin: 12px 0 0;
}
.social-links > li a {
max-height: 48px;
width: 36px;
}
.main-slider .sneakers{
left: 20%;
}
.recommend-block{
margin-top: 40px;
}
.gallery-slider .quarter-size .gallery-photo-desc > div .zoom-image{
transform: scale(0.8) translate(0px, -70%);
}
}
#media screen and (max-width: 992px){
.big-footer .sportify-wrap{
display: none;
}
.big-footer .footer-block{
margin-top: 20px;
}
.contact-form label{
margin-top: 20px;
}
.error-box .sneakers-block{
padding-top: 60px;
}
.new-arrivals > .row > div{
width: 25%;
}
.new-arrivals > .row > div:nth-child(5){
border-top: medium none;
}
.new-arrivals > .row > div:nth-child(5n+1){
border-left: medium none;
}
.new-arrivals > .row > div:nth-child(4n+1){
border-left: 1px solid #e5e5e5;
}
.team-item header a{
width: 50%;
}
.team-list > li{
width: 50%;
}
.shop-slider .round-offer{
left: 50%;
}
.shop-slider .round-offer{
width: 286px;
height: 286px;
left: 40%;
}
.shop-slider .round-offer:before{
width: 334px;
height: 334px;
}
.member-box figure img{
width: 100%;
}
.commentlist > li .children{
margin-left: 20px;
}
.member-box .content{
min-height: 100px !important;
}
}
#media screen and (max-width: 768px){
.main-header .ad{
margin-top: 18px;
}
.main-header .socials{
display: none;
}
.big-footer .footer-block{
padding-bottom: 60px;
}
.big-footer .contact-block{
position: relative;
width: auto;
bottom: auto;
left: auto;
}
.big-footer .contact-block textarea{
margin-top: 30px;
}
.big-footer .contact-block .form-submit{
text-align: center;
}
.filter-box ul li,
.filter-box > div{
width: 100%;
}
.filter-box ul li a{
font-size: 18px;
padding: 10px;
}
.timetable thead tr > th:nth-child(1),
.timetable tbody tr > th{
display: none;
}
.new-arrivals > .row > div{
width: 50%;
}
.new-arrivals > .row > div:nth-child(3),
.new-arrivals > .row > div:nth-child(4),
.new-arrivals > .row > div:nth-child(5){
border-top: medium none;
}
.new-arrivals > .row > div:nth-child(5n+1){
border-left: medium none;
}
.new-arrivals > .row > div:nth-child(2n+1){
border-left: 1px solid #e5e5e5;
}
.about-box header .header-block .entry-header{
position: static;
top: 0;
left: 0;
}
.blog-box figure img{
width: 100%;
}
body .woocommerce-page .mobile-menu-button{
width: 52px;
height: 52px;
right: 160px;
}
.news-block .news-list li .row > div:hover:before{
height: 100%;
}
.commentlist > li .children{
margin-left: 10px;
}
.blog-box .blog-items > div{
width: 100%;
}
}
#media screen and (max-width: 724px){
.main-header .ad{
margin-top: 15px;
}
body .mobile-menu-button {
right: 22px;
}
.team-list > li{
width: 100%;
}
.tp-bullets {
margin-left: 5% !important;
}
}
#media screen and (max-width: 670px){
.woo-container .shopping-cart-wrap .coupon-code-block .coupon-field{
width: 50%;
}
.woo-container .shopping-cart-wrap .coupon-code-block .button{
width: 50%;
}
.update-cart{
float: none;
text-align: right;
margin-bottom: 20px;
}
}
#media screen and (max-width: 640px){
.nav-bar .identity{
text-align: center;
}
.nav-bar .identity img{
max-height: 40px;
max-width: 120px;
}
body .woocommerce-page .mobile-menu-button{
right: 130px;
width: 42px;
height: 42px;
background-position: 0 -2px;
}
body .woocommerce-page .search-block{
display: none;
}
body .woocommerce-page header .col-xs-4{
width: 100%;
}
body .woocommerce-page > header .cart-all{
margin-left: 15px;
}
body .woocommerce-page > header .cart-all i,
body .woocommerce-page > header .cart-all .amount{
width: 50%;
}
body .woocommerce-page > header .col-xs-3{
width: 100%;
}
.show-content > header .col-xs-4{
width: 100%;
}
.show-content > header .ad{
display: none;
}
.page-slider-block ul li .col-xs-6{
width: 100%;
}
.page-slider-box .slider-controls{
bottom: 30%;
}
.checkout_coupon input[type="text"]{
min-width: 120px !important;
width: auto !important;
}
}
#media screen and (max-width: 480px){
.sneakers-block{
display: none;
}
body .woocommerce-page .mobile-menu-button{
right: 10px;
}
.team-item header a{
width: 100%;
text-align: center;
padding: 10px 0 4px 10px;
}
.team-item header a br{
display: none;
}
.classes-box .classes{
width: 100%;
left: 0;
}
.classes-box nav .toggle-content .entry-header{
padding-top: 20px;
margin-top: 12px;
}
.classes-box nav .toggle-content{
position: relative;
left: 0;
width: 100%;
}
.classes-box .classes-content-block .read-more{
position: relative;
bottom: 0;
right: 0;
font-size: 20px;
line-height: 18px;
margin-top: 20px;
padding: 12px 50px 8px 0px
}
.box-header .entry-header{
font-size: 22px;
line-height: 28px;
}
body .mobile-menu-button{
right: 10px;
}
}
This is my CSS for mobile version of site..
To scroll navigation only use following css code
#media (max-width: 992px){
body > .main-nav {
overflow: scroll;
}
}
I am new to making responsive websites and from what I have discovered is that you can make a responsive website in 2 different ways, the first is by making everything fluid or like I have done, creating #media screen only and (min-width: 640px) { for a variety of window sizes (max-width: 639px, min-width: 640px, min-width: 760px, min-width: 1020px and min-width: 1280px).
With each of these media queries I have designed the website to suit certain devices in mind, for example 640px is aimed for iPhone. However when uploading the website and viewing it on my iPhone the page was really messed up with scaling all wrong which lead to adding <meta name = "viewport" content = "width = device-width"> but this has lead to my website showing the smallest media query on my iPhone. I can't get the website to display properly on my iPhone with the right media query but on my laptop when I adjust the window size the website changes appropriately.
What am I doing wrong?
The page can be seen here, ivybridgemethodistchurch.co.uk/DEV/index.html.
#media only screen and (max-width: 639px) {
#wrapper {
}
#ne_wrapper {
width: 500px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
.ne {
width: 100%;
height: 130px;
overflow: auto;
margin-top: 20px;
background: #FFF;
position: relative;
}
.ne img {
width: 130px;
margin: 0;
float: left;
position: absolute;
z-index: 100;
}
#ne_tag {
padding: 5px 0;
margin: 0;
position: absolute;
z-index: 200;
top: 0;
left: 0;
background: rgba(67, 149, 142, 0.85);
}
#ne_tag small {
color: #FFF;
margin: 0;
margin-left: 20px;
margin-right: 20px;
padding: 0;
}
#ne_container {
width: 330px;
margin: 20px;
float: right;
}
#ne_title {
margin-bottom: 10px;
}
#te_wrapper {
width: 500px;
margin: 40px auto;
padding-left: 20px;
padding-right: 20px;
}
.te {
width: 500px;
height: 500px;
padding: 0;
position: relative;
overflow: auto;
}
.te img {
width: 100%;
position: absolute;
z-index: 100;
}
#te_container {
margin: 10px;
float: left;
position: absolute;
z-index: 200;
}
#te_title {
float: left;
padding: 15px;
background: #FFF;
}
#te_title h1 {
float: left;
}
#te_details {
float: left;
padding: 15px;
background: #FFF;
}
#te_tag {
float: left;
clear: both;
padding: 5px 0;
margin: 0;
background: rgba(67, 149, 142, 1);
}
#te_tag small {
color: #FFF;
margin: 0;
margin-left: 20px;
margin-right: 20px;
padding: 0;
}
#te_description {
display: none;
}
#pe_wrapper {
width: 500px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
.pe {
width: 100%;
overflow: auto;
margin-top: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #FFF;
}
.pe img {
width: 100px;
float: left;
margin-right: 10px;
}
#pe_container {
width: 350px;
overflow: auto;
float: right;
padding: 20px;
background: #FFF;
}
#pe_title {
padding-bottom: 10px;
margin-bottom: 15px;
border-bottom: 1px solid #DDD;
}
.no_1 {
margin-top: 20px;
}
}
#media only screen and (min-width: 640px) {
#nav {
width: 100%;
height: 55px;
background: red;
border-bottom: 1px solid #DDD;
position: absolute;
}
#outer {
top: 55px;
width: 100%;
position: absolute;
}
#wrapper {
}
#ne_wrapper {
background: purple;
width: 600px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
.ne {
width: 100%;
min-height: 150px;
overflow: auto;
margin-top: 20px;
background: #FFF;
position: relative;
}
.ne img {
width: 150px;
float: left;
position: absolute;
z-index: 100;
}
#ne_container {
width: 410px;
margin: 20px;
float: right;
}
#ne_title {
padding-bottom: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #DDD;
}
#ne_tag {
padding: 5px 0;
margin: 0;
position: absolute;
z-index: 200;
top: 0;
left: 0;
background: rgba(67, 149, 142, 0.85);
}
#ne_tag small {
color: #FFF;
margin: 0;
margin-left: 20px;
margin-right: 20px;
padding: 0;
}
#te_wrapper {
width: 600px;
height: auto;
margin: 40px auto;
padding-left: 20px;
padding-right: 20px;
}
.te {
width: 600px;
height: auto;
padding: 0;
position: relative;
overflow: auto;
}
.te img {
width: 350px;
float: left;
position: relative;
}
#te_container {
width: 250px;
margin: 0;
float: right;
position: inherit;
}
#te_tag {
padding: 5px 0;
margin: 0;
position: absolute;
z-index: 200;
top: 0;
left: 0;
background: rgb(67, 149, 142);
}
#te_tag small {
color: #FFF;
margin: 0;
margin-left: 20px;
margin-right: 20px;
padding: 0;
}
#te_title {
width: 220px;
float: left;
padding: 15px;
background: rgba(255, 255, 255, 0.95);
}
#te_title h1 {
float: left;
}
#te_details {
width: 220px;
float: left;
margin-top: 1px;
padding: 15px;
background: rgba(255, 255, 255, 0.95);
}
#te_description {
display: none;
}
#pe_wrapper {
width: 600px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
.pe {
width: 100%;
overflow: auto;
margin-top: 20px;
background: #FFF;
}
.pe img {
width: 120px;
float: left;
}
#pe_title {
padding-bottom: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #DDD;
}
#pe_container {
width: 440px;
margin: 20px;
float: left;
}
}
#media only screen and (min-width: 760px) {
#wrapper {
}
#ne_wrapper {
width: 720px;
}
#ne_container {
width: 530px;
}
#te_wrapper {
width: 720px;
margin-bottom: 20px;
}
.te {
width: 720px;
}
#te_container {
width: 370px;
}
#te_title {
width: 340px;
}
#te_details {
max-width: 340px;
}
#pe_wrapper {
width: 720px;
overflow: auto;
}
#st {
width: 350px;
float: left;
}
#nd {
width: 350px;
float: right;
}
.pe {
width: 350px;
height: 457px;
position: relative;
}
.pe img {
width: 350px;
}
#pe_container {
width: 310px;
margin: 10px;
padding: 10px;
height: auto;
position: absolute;
bottom: 0;
background: #FFF;
}
}
#media only screen and (min-width: 1020px) {
#wrapper {
width: 980px;
margin: 0 auto;
}
#ne_wrapper {
width: 910px;
float: left;
}
.ne {
width: 700px;
background: transparent;
border-left: 10px solid rgb(67, 149, 142);
}
#ne_inner {
margin-left: 20px;
}
#ne_tag {
display: none;
}
#ne_container {
width: 490px;
min-height: 110px;
background: #FFF;
padding: 20px;
margin: 0;
}
#te_wrapper {
width: 940px;
}
.te {
width: 740px;
}
#te_container {
width: 340px;
padding: 20px;
background: #FFF;
}
#te_title,
#te_details {
margin: 0;
padding: 0;
}
#te_title {
padding-bottom: 10px;
border-bottom: 1px solid #DDD;
}
#te_details {
padding-top: 10px;
}
#pe_wrapper {
width: 940px;
clear: both;
}
#st,
#nd {
width: 100%;
float: left;
clear: both;
}
.pe {
width: 300px;
height: 405px;
float: left;
background: #FFF;
}
.pe img {
width: 300px;
}
#pe_container {
width: 260px;
}
.no_1,
.no_2,
.no_4,
.no_5 {
margin-right: 20px;
}
}
#media only screen and (min-width: 1280px) {
#wrapper {
width: 1120px;
margin: 0 auto;
overflow: auto;
}
#ne_wrapper {
width: 1090px;
margin: 0 auto;
padding-left: 0;
padding-right: 0;
float: left;
padding-bottom: 20px;
}
.ne {
width: 730px;
}
#ne_container {
width: 520px;
}
#te_wrapper {
width: 1120px;
}
.te {
width: 1120px;
height: 360px;
position: relative;
}
.te img {
width: 360px;
position: absolute;
z-index: 100;
}
#te_container {
width: auto;
position: absolute;
z-index: 200;
top: 20px;
left: 350px;
margin: 0;
padding: 0;
background: transparent;
}
#te_tag {
background: rgb(67, 149, 142);
}
#te_title {
width: auto;
max-width: 730px;
overflow: auto;
float: none;
padding: 20px;
margin: 0;
margin-top: 28px;
background: #FFF;
border-bottom: 1px solid #F4F1EB;
}
#te_details {
float: none;
overflow: auto;
padding: 20px;
margin: 0;
background: #FFF;
border-bottom: 1px solid #F4F1EB;
}
#te_description {
display: block;
width: 730px;
position: absolute;
z-index: 200;
margin: 0;
padding: 20px;
background: #FFF;
}
#te_description h5 {
margin: 0;
padding: 0;
font-family: 'Roboto', sans-serif;
font-weight: 300;
}
#pe_wrapper {
width: 1120px;
margin: 0 auto;
clear: both;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
#st,
#nd {
width: 100%;
float: left;
clear: both;
}
.pe {
width: 360px;
height: 480px;
}
.pe img {
width: 360px;
}
#pe_container {
width: 300px;
margin: 20px;
}
.no_1,
.no_2,
.no_4,
.no_5 {
margin-right: 20px;
}
}
#media only screen and (min-width: 1360px) {
}
Your media queries are not correct
#media only screen and (max-width: 639px) { }
#media only screen and (min-width: 640px) { }
#media only screen and (min-width: 760px) { }
#media only screen and (min-width: 1020px) { }
#media only screen and (min-width: 1280px) { }
#media only screen and (min-width: 1360px) { }
This will result in applying styles of #media only screen and (max-width: 639px) { } because all other media queries are overridden by it as you have given min-width to all queries, thus it takes lowest min-width and applies it for all sizes.
Change it to
#media only screen and (max-width: 639px) { }
#media only screen and (min-width: 640px) and (max-width: 759px) { }
#media only screen and (min-width: 760px) and (max-width: 1019px) { }
#media only screen and (min-width: 1020px) and (max-width: 1279px) { }
#media only screen and (min-width: 1280px) and (max-width: 1359px) { }
#media only screen and (min-width: 1360px) { }
To explain you media queries in detail, refer css getting changed when applying css media queries for responsive design
I will also put some part of that answer here for further reviews of this post.
include this in <head></head> (if you have not)
<meta name="viewport" content="width=device-width, user-scalable=no" /> <-- user-scalable=yes if you want user to allow zoom -->
change you #media style as this // change width as per your requirements
#media only screen (max-width: 500px) {
// or as per your needs, as I try to explain below
}
Now I try to explain maybe..:)
#media (max-width:500px)
for a window with a max-width of 500px that you want to apply these styles. At that size you would be talking about anything smaller than a desktop screen in most cases.
#media screen and (max-width:500px)
for a device with a screen and a window with max-width of 500px apply the style. This is almost identical to the above except you are specifying screen as opposed to the other media types the most common other one being print.
#media only screen and (max-width:500px)
Here is a quote straight from W3C to explain this one.
The keyword ‘only’ can also be used to hide style sheets from older user agents. User agents must process media queries starting with ‘only’ as if the ‘only’ keyword was not present.
As there is no such media type as "only", the style sheet should be ignored by older browsers.
Example
#media all and (min-width: 500px) {
}
#media all and (max-width: 500px) and (min-width: 300px) {
}
#media all and (max-width: 299px) {
}