1
I am capturing emails to be shown on screen, in html.
But my page has some styles already applied, so I include html extracted from the email body.
The styles present in this html change the one on my page.
Is there any way to prevent "imported" styles from changing my page or "isolating" the html styles that come from the email body exclusively for a div ?
In the example below, you can notice that html comes with numerous styles. And it is exactly these that alter all my original page style.
<style>
*{ font-family: "Times New Roman", Times, serif; }
</style>
<div id="de" class="campo_email">
<b>De</b>: [email protected]
</div>
<div id="para" class="campo_email">
<b>Para</b>: [email protected]
</div>
<div id="data_envio" class="campo_email">
<b>Data</b>: 2000-01-01 00:00:00
</div>
<div id="assunto" class="campo_email">
<b>Assunto</b>: teste
</div>
<div id="assunto" class="campo_email">
<b>Mensagem</b>:
<div id="mensagem">
<!-- AQUI VAI O HTML DO CORPO DO EMAIL -->
<!-- POR EXEMPLO O ABAIXO -->
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="x-apple-disable-message-reformatting">
<title>Parabéns! capSAT Rastreamento 24h</title>
<link href="https://fonts.googleapis.com/css?family=Poppins:300,300i,400,400i,700,700i,800,800i" rel="stylesheet">
</head>
<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #222222; font-family: 'Poppins', sans-serif;">
<center style="width: 100%; background-color: #f1f1f1;">
</div>
</div>
Why not just capture the data you need?
– MagicHat
Why I can’t predict answers. Each answer will have a format.
– Pedro Augusto