>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>
I’ll show you my html, and css.
My jpeg images are way to, big, and I tried to change the width, and height, but it didn’t work I also tried object-fit element, but it didn’t work either. I don’t know why nothings working.
could putting a negative symbol make the image decrease for example: width: -10px
2
Answers
It’s really simple, remember that the last style applied to your element will prevail, and that styles applied by hashtag symbol are implemented over id’s.
You can debug your styles live in your web browser pressing F12 and using inspector tool.
With your example would be