私は自分のために簡単なウェブサイトを作っています。ブラウザでウェブサイトを開いてブラウザの横幅を小さくすると、本文/白い矩形が画面から消えます。これを防ぐ方法を教えてください。問題のボディが画面から外れるのを防ぐにはどうすればいいですか?
スクリーンショット: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