나는 나 자신을 위해 간단한 웹 사이트를 만들고있다. 브라우저에서 웹 사이트를 열고 브라우저의 가로 폭을 줄이면 body/white 사각형이 화면에서 사라집니다. 어떻게 이런 일이 일어나지 않도록합니까? 문제의본문이 화면에서 벗어나는 것을 방지하려면 어떻게해야합니까?
스크린 샷 :
http://imgur.com/a/V5EtZ는 또한, 내 코드에 어떤 결함/문제를 지적 주시기 바랍니다. 나는 웹 개발에 익숙하지 않고 내가 얻을 수있는만큼 많은 비판을 필요로한다.
html {
background-image: url("bg.jpg");
padding: 150px;
background-repeat: no-repeat;
background-size: 100% 100%;
}
h1 {
line-height: 15px;
text-align: center;
font-weight: 600;
color: rgba(61, 61, 61, 0.7);
}
h3 {
line-height: 0px;
text-align: center;
font-weight: 100;
color: rgba(61, 61, 61, 0.7);
}
hr {
border: 0;
color: red;
border-bottom: 1px solid rgba(168, 168, 168, 0.92);
width: 320px;
}
p {
text-align: center;
}
body {
padding: 25px;
max-width: 400px;
min-width: 400px;
height: 200px;
font-family: "Courier New", Courier, monospace;
background: #fafafa;
margin: auto;
border-radius: 3px;
box-shadow: 0px 0px 90px rgba(58, 58, 58, 0.71);
opacity: 0.95;
position: static;
}
footer {
margin-top: 45px;
opacity: 0.5;
}
<html lang="en">
<head>
<meta charset="utf 8" />
<title>JOSH BAKOS</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<header>
<h1>JOSH BAKOS</h1>
<h3>STUDENT</h3>
</header>
<hr>
<p>I am a Java developer and a future Software Engineering Student @ UOIT.</p>
<p>
<br><a href="https://twitter.com/jzbakos" target="_blank">Twitter</a> • <a href="http://stackoverflow.com/users/6383960/jzbakos" target="_blank">StackOverflow</a> • <a href="https://github.com/jzbakos" target="_blank">Github</a>
</p>
<footer>
<p>© Josh Bakos</p>
</footer>
</body>
</html>
고맙습니다. 빠른 질문 : 카드/흰색 직사각형의 경우 모두 해당 div에 배치해야합니까, 아니면 모두 그대로 몸에 두어야합니까? – jxshu
꽤 좋은 젊은이 – fxm