Reputation: 7
In CSS file, it writes as blow:
img {
max-width: 100%;
height: auto;
}
In HTML, I write this:
<img height="1" width="340">
The result is width:340,height:341
but I want the height=1
.
The css file can not be modified and I must use it.
There has a lot of <img>
tags and the height is different.
How to make the height: auto;
invalid?
Upvotes: 1
Views: 456
Reputation: 6470
img, video { max-width:100%; height: auto;}
img{
max-height: 1px;
display: block;
}
<img height="1" width="340" src="http://lorempixel.com/400/200/nature/">
Upvotes: 1
Reputation: 1406
you can write inline css like.
<img style ="height:1px; width:340px;" >
Because inline CSS has more power than external or internal css
Upvotes: 0