Can this code be replicated using the style attribute?
<style>
#red-paragraphs > p {
color:red;
}
</style>
<div id="red-paragraphs">
<p>red paragraph</p>
<p>another red paragraph</p>
</div>
<div>
<p>not red paragraph</p>
</div>
Somehow like this:
<div style="????????">
<p>red paragraph</p>
<p>another red paragraph</p>
</div>
<div>
<p>not red paragraph</p>
</div>
I would only be using the style once, and I would like to change the file where the change is being done.
with a reference to HTML Style Attribute
<div style="color: red;opacity: 0.5;"> <p>red paragraph</p> <p>another red paragraph</p> </div> <div> <p>not red paragraph</p> </div>
inline styling does not support child selecting inheritance since that's what CSS made for. you can only do this:
<div> <p style="color: red;opacity: 0.5;">red paragraph</p> <p style="color: red;opacity: 0.5;">another red paragraph</p> </div> <div> <p>not red paragraph</p> </div>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.