View Single Post
Old 11-27-2014, 02:01 AM   #18
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by rosshalde View Post
What I need to learn is when difference codes in the CSS override one another.
In general that would be cascading, it works down into the child tags. So, if you for example:
Code:
<div  class="dummy">Dummy text</div>
<div class="dummy"><p>dummy text 2</p></div>
Let's say you have a simple stylesheet like this:
Code:
div.dummy {font-style: italic;}
p {font-style-normal;}
In this case 'Dummy text' would be italic, but 'dummy text 2' not. The attribute is overwritten. In order to overwrite a certain attribute, it must be addressed. In this example I specifically have given the p-tag the attribute that it must not be italic. Normally a p-tag is never italic unless specified otherwise, so it seems redundant. However, since it would need to overwrite the font-style of the div-tag, I need to specify it.

I hope this makes it clear. This is a simple example, but it can become complex quite fast. That is why an Inspector is useful, to see where the value of the attributes are coming from. Both Sigil and Calibre editor have these by default.
Toxaris is offline   Reply With Quote