>my css
body {
background-color: rgb(52, 51, 51);
text-decoration-color: aliceblue;
font-family: Georgia,
"Times New Roman", Times, serif;
text-transform: uppercase;
font-weight: bold;
}
li {
float: left;
list-style-type: none;
padding: 10px;
display: block;
width: 90%;
}
#images {
border: 1px solid #ddd;
border-radius: 4px;
padding: 5px;
width: 10%;
height: auto;
max-width: 50%;
object-fit: contain;
}
>my html
<html>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="candy fruit mushrooms" />
<meta name="author" content="MelL" />
<meta name="keywords" content="candy, fruit, mushroom" />
<link rel="stylesheet" type="text/css" href="camera.css" />
<title>photoshop</title>
</head>
<body>
<hearder>
<h1>CAMERA</h1>
<nav>
<ul>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
</hearder>
<main>
<h2>RESENT</h2>
<p>
slice of fat, kjfjngknklgj jvnbjhvhnn jhnhnjhnjhnjnhjhnbjbnj
ngjnkjgntfjngjtnjknjgnjjnjkjbnjkbjnjjnbjgnjnjknjkynjnjnjnjn
htjftgjtfnjkntjnjnjnkjgynkjnjknkjnjknjnjknjhjkjkhjkhjkgnbjn
</p>
<div id="images">
<img src="./photos/cracked.jpg" alt="" />
<img src="./photos/cup.jpg" alt="" />
<img src="./photos/boss.jpg" alt />
<img src="./photos/eagly.jpg" alt="" />
<img src="./photos/dark.jpg" alt="" />
<img src="./photos/freeway.jpg" alt="" />
<img src="./photos/hiway-1.jpg" alt="" />
<img src="./photos/hiway-2.jpg" alt="" />
<img src="./photos/hiway-3.jpg" alt="" />
<img src="./photos/jamel.jpg" alt="" />
<img src="./photos/headphone.jpg" alt="" />
<img src="./photos/momma.jpg" alt="" />
<img src="./photos/nervous.jpg" alt="" />
<img src="./photos/throwup.jpg" alt="" />
<img src="./photos/shirt.jpg" alt="" />
<img src="./photos/room.jpg" alt="" />
<img src="./photos/portrait.jpg" alt="" />
</div>
</main>
<footer>
<nav>
<ul>
<li>instagram</li>
<li>facebook</li>
<li>e-mail</li>
<li>Contact</li>
<li>about</li>
</ul>
</nav>
</footer>
</body>
</html>
</html>
我会给你看我的HTML和CSS。
我的jpeg图像太大了,我试着改变宽度和高度,但不起作用,我也试过对象适应元素,但也不起作用。我不知道为什么什么都不起作用。可以把一个负数使图像减少例如:宽度:-10像素
2条答案
按热度按时间xkrw2x1b1#
这真的很简单,记住最后一个应用到元素的样式将占上风,并且hashtag符号应用的样式是在id上实现的。
您可以调试您的风格生活在您的网页浏览器按F12和使用检查器工具。
以你为榜样
blmhpbnm2#