How To Isolate a div from public CSS styles?

后端 未结 5 1669
栀梦
栀梦 2020-11-27 13:44

i have some code for example here in html


 
  
  

Hi it\'s test

5条回答
  •  萌比男神i
    2020-11-27 13:54

    You cannot technically, that's how CSS is suppose to work. If there is any style defined for div tag in your style sheet it will be applied to all div elements.

    Few things that you can try is don't style with tag name instead give class name and give style declaration to class. so that you can make sure where all styles will go.

    OR. if you want some specific Div tag to not have the style while other Divs to have. you can always reset it give some different class name or id and reset the style declarations

提交回复
热议问题