How to preserve styles of embedded widget?

前端 未结 5 1070
我寻月下人不归
我寻月下人不归 2021-01-05 11:39

How to make an external PHP widget page have its own CSS. The catch is - when the external page is included it\'s been affected by the stylesheet of th

5条回答
  •  太阳男子
    2021-01-05 12:08

    You might want to apply a mini CSS reset on your included code. Surround your code in a unique id, like so:

    Now apply the reset to everything inside this, using a basic CSS reset like Eric Meyer's, available here: http://meyerweb.com/eric/tools/css/reset/

    Now, apply your own CSS. Nearly all outside CSS will be wiped out, and yours will be applied.

提交回复
热议问题