[dokuwiki] Re: Different css for text elements
- From: Dennis Heuer <einz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Sun, 7 Jan 2018 19:44:48 +0100
On Sun, 7 Jan 2018 18:33:53 +0300
"Zen-Do.Ru" <admin@xxxxxxxxx> wrote:
But yes, CSS declarations are cascading: (1) inherited and (2) CAN be
overwritten. For example, any style rule for DIV can be overpowered
by rule for DIV P:
div p {
text-decoration: none;
}
div {
text-decoration: underline;
}
Despite the fact that the style for DIV in this example was defined
AFTER the style for DIV P, any paragraphs in divs will retain
"text-decoration: none". It means we can change styles in a very
detailed manner, based on the degree of specificity of target
elements.
Yes, but this "overpowers" individual configs for the children as well.
Even in a weird, hardly calculatable mix up, which is bad!!!
This here works as expected (in firefox):
<div style="margin: 2cm;text-decoration: blue dotted underline;">
// p rules over div!
<p style="margin: 2cm;text-decoration: green solid underline;">Text!</p>
</div>
This here works better than expected:
<div style="margin: 2cm;text-decoration: blue dotted underline;">
// p rules all over div, giving a black line!
<p style="margin: 2cm;text-decoration: underline;">Text!</p>
</div>
Here the config "green" for p is ignored:
<div style="margin: 2cm;text-decoration: blue dotted underline;">
<p style="margin: 2cm;text-decoration: green;">Text!</p>
</div>
This here even mixes up!
<div style="margin: 2cm;text-decoration:blue dotted underline;">
<p style="margin: 2cm;text-decoration:green wavy underline;">Text!</p>
</div>
Well, so it is! Have to live with it!
Happy coding!
Алексей Постоянное Озарение
-- DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist
Regards,
---------------------------------------------------------------------
Dennis Heuer
einz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist
Other related posts: