Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74735

in html email, how to use a parent tag to override the browser default for children p tags?

$
0
0

In an HTML email, how can a parent container with an INLINE* text style have that style inherited by all p tags within that parent?

In an HTML email, the paragraph tag text seems to be unaffected by the parent's style, whether the parent container is a table\tr\td or span or div (shown below)... I even tried reporting to !important:

<div style='color:#640494 !important;font-size:1.25em !important;'>
  <p>more stuff<br>
    to test</p>

  <p>here and here</p>
</div>

In that example above the p text is the browser default.

Applying the style directly to each p tag is problematic in this case, because the email is programmatically generated and the block of text inside the parent is loaded from another source as plain html (no css).

* defining a named div style in the email header such as #extra_note_text p {color:#640494; font-size:1.25em;} works for forcing child p tag styles, but for one-off formatting needs, it seems there ought to be an inline CSS way to accomplish the same thing rather than cluttering the email template file with one-off styles


Viewing all articles
Browse latest Browse all 74735

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>