L
L
ligisayan2016-11-18 12:58:24
css
ligisayan, 2016-11-18 12:58:24

Why don't media queries work on some computers?

Hello! There is a site on wordpress , where in my own theme I register bootstrap styles and my own style through the functions.php file

// регистрируем стили
add_action( 'wp_enqueue_scripts', 'register_plugin_styles' );

// регистрируем файл стилей и добавляем его в очередь
function register_plugin_styles() {
  wp_register_style( 'bootstrap-css', get_template_directory_uri() . '/css/bootstrap.min.css' );
  wp_enqueue_style( 'bootstrap-css' );
  wp_register_style( 'style', get_template_directory_uri() . '/style.css' );
  wp_enqueue_style( 'style' );
}

media queries are written in style.css , and sequentially it appears later than bootstrap.css
.navbar-inverse .navbar-nav>li>a {
    padding: 34px 7px 38px;
    }
@media screen and (min-width: 1310px) and (max-width: 1366px)  {
  .navbar-inverse .navbar-nav>li>a {
    padding: 34px 15px 38px;
  }
}
@media screen and (min-width: 1440px) {
  .navbar-inverse .navbar-nav>li>a {
    padding: 34px 10px;
  }
}
@media screen and (min-width: 1600px) {
  .navbar-inverse .navbar-nav>li>a {
    padding: 34px 15px;
  }
}
@media screen and (min-width: 1680px) {
  .navbar-inverse .navbar-nav>li>a {
    padding: 34px 20px;
  }
}
@media screen and (min-width: 1920px) {
  .navbar-inverse .navbar-nav>li>a {
    padding: 34px 31px;
  }
}

But I can’t understand why on some computers and laptops media queries work and are visible through the code editor (laptop 15 inches), and on some not, only bootstrap media queries are visible (laptop 13 - resolution 1366px, computer with monitor 22 - resolution 1920px) and do not work accordingly..
on services like quirktools.com/screenfly/ it works at all resolutions

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2016-11-18
@Palych_tw

Well, it is obvious that "laptop 13, computer with monitor 22" do not fall into the width range from 1310 to 1366, so queries do not work for them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question