Is there any way to render HTML code with great style in isolation from the rest of the site’s styles?

I am trying to figure out a way to display an archive of email newsletters on my client site. The problem is that newsletters are full of built-in styles, which is great for viewing in Outlook or anywhere, but they don't look too hot in another, beautifully designed site.

My goal is for my client to copy the entire source code of the generated newsletter (which her list management company * gives her access to) and paste it into the CMS (drupal, if that matters).

* Permanent contact? Chimpanzee mail I forgot. One of them.

Then I would like to display it on my site, inside the main structure (heading, navigation, etc.) of the rest of the site. If it were in 1997, I would say "iframes!". and do with it, but A), which looks like a lame solution, and B) the code does not actually exist on the page itself, which, I think, is required for iframes.

Is there any tag that I can place around this HTML block to isolate it from the rest of the site’s styles? Or is there another way to do this completely?

Thanks!

+3
source share
3 answers

IFrames - , - . CSS .

, iframe, , . , , , JavaScript / iframe.

, div , JavaScript div iframe. , JavaScript.

+3

HTML , -, . . , - javascript, , .

, -, , b, a, h *, blockquote , , . CMS. , -.

, CSS, , , CSS CMS . , CSS reset :

.post p {
     margin: 0;
     ... 
.post /* all the standard CSS reset rules preceded with .post */

<div class="post"> content parsed from your CMS </div>
+1

, ? , , , . , inline so-to-speak, .

0

Source: https://habr.com/ru/post/1709411/


All Articles