1

I'm using social API which is dynamically adding the class on <a></a>. I want to remove all style property of dynamically add class.

CSS

a.api_sytle{

    background-image: url(https://s-passets.pinimg.com/images/pidgets/pinit_bg_en_rect_gray_20_1.png)!important;
    cursor: pointer!important;
    background-repeat: none!important;
    background-size: 40px 60px!important;
    height: 20px!important;
    padding: 0!important;
    vertical-align: baseline!important;
    text-decoration: none!important;
    width: 40px!important;
    background-position: 0 -20px;
}
#pin-socail{
    all: unset;
    }

I searched about it and find this style property all: unset; in this answer, but it does not work.

HTML

<li><a id="pin-socail" href="www.test.api-response.com"></a></li>

Can any one guide me is there possible that i remove the all style from dynamically added class ?

Community
  • 1
  • 1
Ayaz Ali Shah
  • 3,453
  • 9
  • 36
  • 68

1 Answers1

4

Try

#pin-socail{
  all: initial;
 }

if this still doesn't work then you can try with !important keyword. i.e:

#pin-socail{
  all: initial!important;
 }

Here is one demo: http://codepen.io/team/css-tricks/pen/LVxvWP

K K
  • 17,794
  • 4
  • 30
  • 39