Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overriding default img css

Tags:

css

How can i override img css for particular image.

Let say ,

i have css in my website like

img{
border:2px solid #ECECEC;
padding:4px;
}

i have one img with in the website say <img id="example" src="../example.png"/>

Now , i don't want to apply img css to this particular image.

How can i do that?

Thank

like image 671
Yasin Avatar asked Aug 17 '26 02:08

Yasin


2 Answers

use the id as a selector and change the css properties you want.

#example{
  border:0;
  padding: 0;
}
like image 144
Gabriele Petrioli Avatar answered Aug 19 '26 07:08

Gabriele Petrioli


img#example {border:none !important; }

No border for image with example id

like image 21
haha Avatar answered Aug 19 '26 07:08

haha



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!