私はこれが数時間新しいのに苦労していて、それを正しく理解することができません。私のCSSスキルは純粋なので、理解してください。
ですから、私が達成したいのは、Webサイトに画像があり、ブラウザウィンドウのサイズを変更するときに、画像サイズをブラウザサイズに調整する必要があるため、画像全体が表示されるようにすることです。また、画像はページの中央に配置する必要があります。助けてくれてありがとう。
index.php:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<title>James Laycock</title>
</head>
<body>
<div id="main">
<div id="content">
<div id="image_container">
<a href="index.php?page=1"><img src="images/01.jpg" class="image" /></a></div>
</div></div></body></html>
style.css:
body{
margin: 0;
padding: 0;
padding-top: 10px;
text-align: center;}
#main {
height: 90%;
width: 1000px;
position: absolute;
border: 0px;
padding: 0;
margin: 0 auto;}
#content{
height: 90%;
width: auto;
margin-top: 10px;
margin-right:10px;}
#image_container{
height: 100%;
max-height:100%;
width: auto;}
.image{
height: 100%;
width: auto;}