my website scraped information from ebay products and for the description of the product I get all html. Product description has inline styles and when I open the description of the product in my website, products css ovewrite my css
Normal:
And after I opened the product description
Here is anchor style from developer tool
So I need any idea how to separete ebay product css with my css.
One of the methods that I think is to add !important
to all my styles, but I don’t think this solution is elegant and I want something else. So If you have any suggestion how to solve my issue I will appreciate them.
3
Answers
Perhaps you need to update your
css
to be more specific with it’s selector, for example if you have a HTML structure which diferentiate the container of the Product Description from eBay like thisYou can use a
:not
selector to define your main style so it won’t be disrupted by the eBay styleThe more specific your selector is, then your style will be used. But if your selector is the same, then the last rule from top bottom will be applied. So in the above example, the link inside
product-desc
color is set togreen
notblack
create a custom inline CSS property that you desire in the element to overwrite the default CSS. here is how you create inline CSS for overwriting anchor properties.
Here how you do:
create the icons/text of anchor inside a element and give inline CSS
A quick test in Chrome shows that the
does override the inline style, but adding the !important back to the span works fine.
For understanding it better. Learn here Overwriting Hover in anchor
Overwriting visited in anchor
If you want to remove all exist style and reset it to default you can use: