Quote:
Originally Posted by rosshalde
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.