Reputation: 43
How do I change the size of my pictures? I want them all in the same size, what am I doing wrong?
HTML:
<img src="tennis.jpg" class="aktiviteter">
<img src="venner.jpg" class="aktiviteter">
<img src="shopping.jpg" class="aktiviteter">
CSS:
.aktiviteter {
width="450px"
height="300px"
}
Upvotes: 0
Views: 94
Reputation: 346
Sometimes I like to make images part of the background. I've found they respond better on different screens.
<div class="container"><img src="tennis.jpg" class="aktiviteter"></div>
<div class="container"><img src="venner.jpg" class="aktiviteter"></div>
<div class="container"><img src="shopping.jpg" class="aktiviteter"></div>
.container:nth-child(1) {
height:300px;
width: 450px
background: url('../tennis.jpg') no-repeat center;
}
Replace your =
with :
.aktiviteter {
width: 450px;
height: 300px;
}
Upvotes: 0
Reputation: 7661
Have a look at some documentation it would have prevented you from asking a question like this.
.aktiviteter {
width:450px;
height:300px;
}
<img src="https://cdn.pixabay.com/photo/2016/05/09/11/09/tennis-1381230_960_720.jpg" class="aktiviteter">
<img src="https://cdn.pixabay.com/photo/2017/07/31/20/36/dark-2560832_960_720.jpg" class="aktiviteter">
<img src="https://cdn.pixabay.com/photo/2015/10/12/15/18/store-984393_960_720.jpg" class="aktiviteter">
Upvotes: 0
Reputation: 61
You dont use "=" in css, and you dont need quotes. Also try ending the statement with semi colons
.aktiviteter {
width: 450px;
height: 300px;
}
Upvotes: 2