Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use CSS to put img attributes

Tags:

html

css

Can I use CSS programmatic to put the attributes of my img tag?

<span><img class="img-dollar"></img></span> 

<span><img class="img-royalty"></img></span> 

I want to put src to get the image and put height and width to scale it down. How can I achieve?

like image 284
Drixson Oseña Avatar asked Feb 26 '26 18:02

Drixson Oseña


1 Answers

The answer is No. You can't manipulate the html tags with the help of css. Use javascript for that.
CSS is only used for manipulate the style attributes.

To change the height and width property using css you can do something like this

.img-dollar
{
   height:100px;
   width: 100px
}
like image 116
Sachin Avatar answered Mar 01 '26 09:03

Sachin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!