A
A
Andrey Shirokikh2020-11-08 10:54:36
css
Andrey Shirokikh, 2020-11-08 10:54:36

Media screen query not working in wordpress theme styles, how to make it work?

Good afternoon.
I am writing a site on WP, without additional plugins and constructors, the theme is stock, I write html in the stock code editor, I write css in additional theme styles.
I wanted to start implementing adaptive layout in these additional styles, initially I did it for the desktop, marked out the range for it, everything works. Registered for mobile phones:

@media screen and (max-width: 768px) {

}


And I started inserting the layout for already existing html elements there, changed or those in the desktop range, it doesn’t matter. The media query is not working. More specifically, it is present in the code view in the browser, with a changed layout, but these properties are stupidly not applied, as if I did not write them. And the html elements end up not being styled on the page in that range.
How to make properties for other ranges work? Can you advise what plugin or where should I insert these media queries with changed properties so that they are saved and applied?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2020-11-08
@Kozack

@media screenand(min-width: 768px) {

A
Artem Zolin, 2020-11-09
@artzolin

Well, let's exclude a few more common problems
1. wp_head()Is there any topic at all?
2. Cash? ctrl+f5?
3. Are you sure you are watching at a resolution less than 768?
If it doesn't help, then use the good old-fashioned debugging: disable all plugins, enable the default theme. Is it working fine now? Then turn on the plugins one by one. If you haven’t found a problem, then search and check everything that is on hooks in the theme initand after_setup_themecompare with the default theme

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question