css code is not applying between 730px to 760px - html

I am making footer responsive.I have write css code for footer column. Which are as below
CSS
#media (min-width:300px) and (max-width:749px) {
------ css code---
}
#media (min-width:750px) and (max-width:1200px) {
----css code---
}
Now I didnot get result for width in between 730px to 760px.
Footer is distorted between this range.Which should be fine up to 749px as it above code.

Try this it works fine for me.
#media screen and (max-width: 1200px) {
.your-css-class{
/*your css styles here*/
}
}
#media screen and (max-width: 750) {
.your-css-class {
/*your css styles here*/
}
}
#media screen and (max-width: 730) {
.your-css-class {
/*your css styles here*/
}
}

Related

Not displaying input tag on certain devices

I'm trying to not display different input tags for different devices.
I have three input tags <input class="desktop"/> <input class='tablet'><input class= 'mobile'>
I'm not displaying desktop and mobile input tags by adding the css like this:
.desktop {
#media(max-width: 767px){
display: none
}}
.mobile {
#media (min-width: 768px) {
display: none;
}}
I'm having difficulty restricting it for tablet though. My tablet dimensions are between 768px and 1024 px
I've tried doing this but it doesn't work:
#media (max-width:768px) and (min-width:1024px) {
display: none;
}
Any ideas on how I can control the input tag to only show between these dimensions?
It's just a syntax error. You need to put the class selector inside the media query like this:
#media (max-width: 767px) {
.desktop {
display: none;
}
}
See this example on w3schools
edited The media query just has the max-width and min-width the wrong way round. See below
/* apply at widths below 768px */
#media (max-width:768px) {
body {
background-color: lightskyblue;
}
.tablet, .desktop {
display: none;
}
}
/* apply from widths between 768px and 1024px */
#media (min-width:768px) and (max-width:1024px) {
body {
background-color: goldenrod;
}
.mobile, .desktop {
display: none;
}
}
/* apply from widths above 1024px */
#media (min-width:1024px) {
body {
background-color: lightseagreen;
}
.mobile, .tablet {
display: none;
}
}
<input class='mobile' placeholder="mobile">
<input class='tablet' placeholder="tablet">
<input class='desktop' placeholder="desktop">

How to hide custom-background on desktop (over 992px width)

Why is custom background showing? Here is the css i have added that should work.
#media (min-width: 992px) {
body.custom-background {
background-image: none !important;
display: none; }
}
Link to the website: http://goo.gl/RgG2Ct (scroll down and you will se this strip that is only suppose to be on the mobile version)
You can try with
#media screen and (min-width: 992px)
try this code:
#media (min-width: 992px)
{
body
{
background-image: none !important;
}
}
thanks.
You need to clean things up a bit... try it like this:
#media screen and (min-width: 480px) {
body.custom-background {
background-image: none !important;
display: none;
}}
It seems you have an extra set of () and one misplaced }

Media Queries work when I re size the window but don't work when on other devices

Ive been looking all over and I cant find any solution to this. My media queries don't work on mobile devices but they work when I re size my screen.
YES I do have:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
In the head of my document.
Here are what my media queries look like:
#media only screen and (max-width: 1100px) {
.r-menu {
display:inline;
}
.m-menu {
display:none;
}
}
#media only screen and (max-width: 900px) {
.res-full {
width: 100%;
}
}
Thanks.
Here is the whole code: http://scratchpad.io/marvelous-holiday-5460
Replace only screen with all
#media all and (max-width: 1100px) {
.r-menu {
display:inline;
}
.m-menu {
display:none;
}
}
#media all and (max-width: 900px) {
.res-full {
width: 100%;
}
}
screen is used for computer screens whereas all is used for all media type devices
Do you really need to use "only"?
I found that the only keyword was intended to prevent non-media-query supporting browsers to not load the stylesheet or use the styles. Why don't you try removing it?
Found the mistake Use min-width not max-width
/*If screen is less than 900px don't show full menu*/
#media(max-width: 900px) {
.r-menu {
display:inline;
}
.m-menu {
display:none;
}
}
/*If screen is greater than 900px then show full menu*/
#media(min-width: 901px) {
.res-full {
width: 100%;
}
}
Use this css
#media screen and (max-width: 1100px) { .r-menu {
display:inline;
}
.m-menu {
display:none;
}}
#media screen and (max-width: 900px) {
.res-full {
width: 100%;
}}
working all devices & screens

how to hide a div tag element on mobile view of site

See the website http://www.localjobpool.com
I would like to hide the green top bar in mobi
le view.
Staring code of div tag is:
<div id="info">
<div class="menuHolder">
</div>
</div>
menuHolder and nav are defined in my custom CSS. I tried the solution like
#media screen......
like
#media screen and (max-width: 500px) {
.info .menuHolder .nav {
display: none
}
}
Please tell me how I can hide this bar in mobile view. And where should I insert the code suggested by you...
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
.menuHolder {display:none;}
}
also info is id and not class ( #info .menuHolder )
#media screen and (max-width: 500px) {
#info .menuHolder{
display: none;}
}
Try this media query, it should target all tablets and smartphones. Maybe you can modify its values to adjust to your needs:
#media only screen and (-webkit-min-device-pixel-ratio: 1.3),
only screen and (-o-min-device-pixel-ratio: 13/10),
only screen and (min-resolution: 120dpi) {
.info .menuHolder .nav {
display: none;
}
}
Or the same devices, only on landscape:
#media only screen and (-webkit-min-device-pixel-ratio: 1.3) and (orientation : landscape),
only screen and (-o-min-device-pixel-ratio: 13/10) and (orientation : landscape),
only screen and (min-resolution: 120dpi) and (orientation : landscape) {
.info .menuHolder .nav {
display: none;
}
}
Worked perfectly for me.
Source: https://gist.github.com/marcedwards/3446599
That should work...
#media screen and (max-width: 500px) {
.menuHolder{
display: none;}
}

Hiding image for mobile devices

I'm trying to hide a certain image for mobile devices on my website. I've tried a various of html and css code and i cannot get it to work. It might have something to do with my div class's and Id tags.
please can someone try and get it to work for me?
HTML:
<section id="left-sidebar">
<div class="logo">
<a href="#intro" class="link-scroll">
<img src="assets/images/other_images/logo.png" alt="description of image">
<img src="assets/images/other_images/nav.png" class="nav">
</a>
</div>
CSS:
#media (max-width: 600px) {
#left-sidebar .logo .nav {
display:none;
}
}
You have to use #Media screen:
screen Used for computer screens, tablets, smart-phones etc.
Combine it with pixel-ratio to fit your needs. Check more examples here
For example (for Samsung Galaxy S3):
/* ----------- Galaxy S3 ----------- */
/* Portrait and Landscape */
#media screen
and (device-width: 320px)
and (device-height: 640px)
and (-webkit-device-pixel-ratio: 2)
{
// insert here your custom styles
#left-sidebar .logo .nav {
display:none;
}
}
<style>
.youClassname{display:inline;}
#media screen and (min-width: 320px) {
.yourClassname{
display:none !important;
}
}
#media screen and (max-width: 768px) {
.yourClassname {
display:none !important;
}
}
</style>
I run your HTML and CSS on JSFiddle. I just change your CSS to:
img {
display:none;
}
and got this
not sure if its this what you are looking for
This seemed to work for me, which was odd
#media (max-width: 768px) {
#left-sidebar .logo .nav {
display:none;
}
}
instead using display:none try this
#media (max-width: 600px) {
#left-sidebar .logo .nav {
display:hidden !important;
}
}
this code will work if isn't still not working please check device width and go on
<style>
.youClassname{display:inline;}
#media screen and (max-width: 320px) {
.yourClassname{
display:none !important;
}
}
#media screen and (min-width: 768px) {
.yourClassname {
display:none !important;
}
}
</style>