I’m new to PHP, HTML, CSS and I’m curious on how to with PHP sricpt make your site fit any screen size (f.e. if you open website on phone, if you resize the browser window, if you open DevTools on your browser etc.) If it can be done in CSS that would be nice as well, but if it cannot I would like to get to know how to link your PHP script to your HTML file as well. I did some research on how to fix my problem and tried few things;
<meta name="viewport" content="width=device-width, initial-scale=1,">
With this meta element I tried to make my website responsive.
body{ height: 100vw; width: 100vw; } div{ height: 100%; width: 100%; }
With these CSS styles I tried to make height and width of website by changing from default to 100vw for width, and 100vh for height. When I resize my browser window “right” side of my website do not show, probably because of CSS styles misuse. Also “right” side don’t show when I open my DevTools. To sum up, i can do both CSS styles and PHP scripts on how to fix this problem. If you answer with PHP script, I would like to get explanation on how to link PHP script to HTML file, or this line on HTML is enough:
<script src"file"></script>
?
jordimetil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.