Home>
I'm sorry for rudimentary questions.
When creating a responsive site
@media screen and (max-width: 750px) {}
After writing something like, when you reduce the browser size (or browse the site on a smartphone), you can scroll to the right like an image.
Are there any solutions?
I added a code for practice.
<DOCTYPE html>
<html lang = "en">
<head>
<meta charset = "UTF-8">
<title>Practice</title>
<link rel = "stylesheet" href = "css/reset.css">
<link rel = "stylesheet" href = "css/slicknav.min.css">
<link rel = "stylesheet" href = "https://use.fontawesome.com/releases/v5.6.4/css/all.css">
<link rel = "stylesheet" href = "css/style.css">
<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">
</head>
<body>
<header>
</header>
<nav>
<ul>
<li>Top</li>
<li>Introduction</li>
<li>Menu</li>
<li>Contact</li>
</ul>
</nav>
Oh ah
</article>
Good
</aside>
<footer>
<p>UuUu</p>
</footer>
<script src = "js/jquery-3.4.1.min.js"></script>
<script src = "js/jquery.slicknav.min.js"></script>
<script src = "js/script.js"></script>
</body>
</html>
</DOCTYPE>
@ charset "utf-8";
body {
background-color: white;
width: 960px;
margin: 0 auto 0 auto;
}
/* header */
header {
width: 960px;
background-color: antiquewhite;
}
header img {
}
@media screen and (max-width: 750px) {
header img {
width: 0;
height: 0;
}
}
/ * Set navigation area * /
nav {
text-align: center;
width: 960px;
background-color: azure;
}
nav ul li {
list-style: none;
display: inline-block;
}
nav ul li a {
text-align: center;
text-decoration: none;
width: 130px;
line-height: 70px;
overflow: hidden;
font-size: 24px;
font-weight: bold;
color: black;
background-color: aqua;
}
#menu {
display: none;
}
nav ul li a: hover {
background-color: black;
color: white;
}
@media screen and (min-width: 750px) {
#menu {
display: block;
}
.slicknav_menu {
display: none;
}
}
.slicknav_menu: before {
width: 180px;
height: 50px;
float: left;
background-image:;
background-repeat: no-repeat;
background-position: center left;
background-size: 100%;
content: "";
margin: 0 0 0 19px;
}
.slicknav_menu {
width: 100%;
position: absolute;
top: 0;
width: 100%;
z-index: 10000;
background-color: # 280000;
}
/* Text */
article {
width: 760px;
background-color: beige;
padding: 0 0 1000px 0;
float: left;
}
article h1 {
font-size: 100px;
}
@media screen and (max-width: 750px) {
article {
width: 100%;
margin: 60px 0 0 0;
}
}
/ * aside * /
aside {
width: 200px;
background-color: blanchedalmond;
margin: 0;
float: right;
}
aside img {
display: inline-block;
width: 200px;
}
@media screen and (max-width: 750px) {
aside {
width: 100%;
}
aside img {
width: 27%;
}
/ * footer * /
footer {
clear: both;
width: 960px;
background-color: chartreuse;
}
footer p {
font-size: 30px;
}
-
Answer # 1
Related articles
- css3 - media query screen width numerical specification and number
- css3 - i want to display the background to the edge of the screen like twitter developers
- css3 - about scss media queries
- wordpress - responsive @media screen does not work
- css3 - i want to fade in when the element enters the screen
- css3 - i want to arrange the side-by-side li evenly even if the screen size is changed
- i want to know how to modify the screen layout (html5, css3)
- css3 - is it possible to split the whole screen diagonally into two and put links on the left and right respectively with html,
- css3 - how to arrange side by side in html and css screen layout
- html - @media screen and () not applied as expected
- css3 - media query does not work
- css3 - certain media queries don't work
- html - i'm not sure what the code below shows for @media screen
- html - @media screen and (max-width:○◯px) is not reflected
- css3 - media query not applicable
- css3 - responsive: media queries don't work at all!
Related questions
- html : Is it possible to make the site open on a larger scale?
- jquery - i want to change the font size of the pull-down menu
- html - i want to arrange them side by side by adjusting the width
- html - media query specification does not work
- html - the contents of the li tag do not fit in the li
- html - does not fit in the body
- questions about combining html css animation @keyframes and javascript
- ruby - i want to write css that displays buttons by tapping
- css3 - i want to align both the image and the text (the image with the text below the image) side by side in the center
- javascript - in the accordion menu, i want to manage to open all of them when i open one
Try this for now.