I have a js file that I load on each project page and that analyzes the resolution of the screen.
if ($(window).width() > 1024) {
//Aqui cargara una hoja de estilos para resoluciones mayores a 1024
document.write('<link rel="stylesheet" type="text/css" href="../css/mayor1024.css">');
} else if ($(window).width() == 1024) {
//Aqui cargara una hoja de estilos para resoluciones de 1024
document.write('<link rel="stylesheet" type="text/css" href="../css/menor1024.css">');
} else if ($(window).width() < 1024) {
//Aqui cargara una hoja de estilos para resoluciones menores de 1024
document.write('<link rel="stylesheet" type="text/css" href="../css/menor1024.css">');
}
I have two css files where in the minor1024.css I have the following:
#bloque {
padding-left: 0%;
padding-right: 0%;
}
#formulario {
padding-left: 0%;
padding-right: 0%;
}
and in the mayor1024.css I have this:
#bloque {
padding-left: 5%;
padding-right: 5%;
}
#formulario {
padding-left: 20%;
padding-right: 20%;
}
For example, on the NEWS page, load a table inside a div with this definition:
<div id="bloque" class="ui text container">
(va la tabla)
</div>
later when one chooses a given news, it fills up on the screen inside a div with this structure:
<div id="formulario" class="ui text container">
(va el desarrollo de la noticia)
</div>
This I did because on the screen so that the news did not occupy the full width of the screen (and it made reading difficult) I put a padding on the sides of 20% of the screen.
Now, when I went to a mobile device, anything happened, it looked horrible.
In this way, if the device is mobile, it takes the width of the screen and it should look good.
But the problem I have is that in the mobile I still have a margin on the sides and it does not take me the full width of the screen ... what should this problem be?