N
N
niceevolutionjoke2022-03-06 11:56:57
HTML
niceevolutionjoke, 2022-03-06 11:56:57

How to load another html file with small screen resolutions?

There is a desktop version site, it is necessary that at a screen resolution of, say, 500px, another html document is loaded. With styles, everything is clear, they can be combined and much more, but what to do with html?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2022-03-06
@sslion

Either a JS script is fired first on the page, which decides which html to load, or the server part generates the required html depending on the client's screen resolution.

N
Nadim Zakirov, 2022-03-06
@zkrvndm

Let's say this:

<script>
    if (window.innerWidth <= 500) {
        location.href = '/mobile.php';
    }
</script>

If the width of the window is equal to or less than 500 pixels, then there will be a redirect to the page/mobile.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question