javascript - Two Css Files Have Same Class - Remove class from particular Class, How? -
i calling 2 css files in html page having same class name different properties.
first css file
.text { font-family: verdana; font-size: 11px; color: #000000; text-decoration: none; line-height: 20px; }
second css file
.text{ margin: 0px; font: 13px/20px arial,helvetica,sans-serif; padding: 20px 20px 40px 35px; }
i want remove functionality of .text second css file through jquery or javascript ....
as stated in comments, loading unwanted css rules disable them , apply new rules same existing rule bad practice. if don't want or can't way, modifying existing css or adding new css rules, jquery:
with jquery:
$(document).ready(function() { $('.text').css({'font-family':'verdana', 'font-size':'11px', 'padding':'0', 'margin':'0'}); });
demo: https://jsfiddle.net/chimos/6g9xmxxo/
- so here it's giving
padding
,margin
default values (this can problematic if want.text
use other values margin , padding @ point). - and
font-family
,font-size
defined in first css rule (this can problematic manteinance, since have duplicated code , -or editor/mantainer- need remeber keep things working).
Comments
Post a Comment