Link to home
Start Free TrialLog in
Avatar of steva
steva

asked on

Applying an inline style that applies to child elements

I have an application where people can create text boxes and enter text.  Each account has it's own set of styles in the account DB record, which are applied to each box when it it created:
User generated image.

These go into an inline style attribute of the element:  style = "...."

This works find for styling the box itself, but now I'd like to style the paragraphs that will go in the box.  So when I create the box I'd like to also specify that all paragraphs that go into the later will, for example, have a top margin of 20px.  I need to implement a div p {  } from an inline style attribute, because I have no CSS file to put this into.  So, is there any way to specify in an inline style attribute that a particular style applies not to the element that contains the attribute, but to children of the element, so it operates like a div p?

Thanks for any ideas.
ASKER CERTIFIED SOLUTION
Avatar of David S.
David S.
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of steva
steva

ASKER

Yes, that's what I'd come to.  I thought with CSS3 changing so fast maybe they had stuck in something like this that I didn't know about yet, but I guess not. Thanks for your input.