Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-20-2020, 11:11 AM   #1
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 1,988
Karma: 12681400
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
Cascading Styles & Specificity

This is probably not a Sigil thing, but it's showing up in a Sigil report and I can't figure out if it's my (lack of) understanding of Specificity/Cascading Styles, or if the report function has a baby gremlin...

I have some CSS in the middle of the stylesheet:

Code:
div.quote p.sig {margin:1em 0 0; text-align:right}
and on the last line of the stylesheet I have:

Code:
blockquote.write p.sig {text-align:right; margin:.25em 0 2em}
the html looks like this:

Code:
  <blockquote class="write">
    <p>Howdy,</p>

    <p>Yadda - Yadda</p>

    <p>Yadda Yadda Yadda</p>

    <p class="sig">Mary Poppins</p>
  </blockquote>
When I look at the inspector it shows what I would consider the correct styling being applied to the p.sig:
Code:
blockquote.write p.sig {
    text-align: right;
    margin: .25em 0 2em;
}
However, in Sigil's Classes Used report it shows "div.quote p.sig" as the matched selector. This causes my small brain confusion... Shouldn't the last-est style on the stylesheet be the priority unless something else has higher specificity?
Turtle91 is offline   Reply With Quote
Old 01-20-2020, 02:45 PM   #2
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 4,185
Karma: 2621090
Join Date: Nov 2009
Device: many
The Report does static analysis of only class selectors. Use the Inspector to see the live css being applied. So what does the Inspector show for the css being applied to that element?
KevinH is offline   Reply With Quote
Old 01-20-2020, 03:00 PM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 21,984
Karma: 122040722
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Might need to see a sample epub. I created a simple one from just the data given and both Reports and DevTools showed the "blockquote.write p.sig" selector being used.

Though as Kevin mentioned, the Sigil Reports figure is more for statistical analysis (this class IS being used) rather than for visible css prioritization.

Last edited by DiapDealer; 01-20-2020 at 06:56 PM.
DiapDealer is offline   Reply With Quote
Old 01-20-2020, 06:31 PM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 1,988
Karma: 12681400
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
Quote:
Originally Posted by KevinH View Post
The Report does static analysis of only class selectors. Use the Inspector to see the live css being applied. So what does the Inspector show for the css being applied to that element?
The inspector showed the "blockquote.write p.sig" selector...that's why it's confusing when the report says it is selecting the "div.quote p.sig".

Quote:
Originally Posted by DiapDealer View Post
Might need to see a sample epub. I created a simple one from just the data given and both Reports and DevTools showed the "blockquote.write p.sig" selector being used.

Though as Kevin mentioned, the Sigil Reports figure is more for statistical analysis (this class IS being used) rather than for visible css prioritation.
I closed Sigil and re-opened the same file and it showed the 'correct' selector being used....so, there is that....
Turtle91 is offline   Reply With Quote
Old 01-20-2020, 06:57 PM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 21,984
Karma: 122040722
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
"Have you tried turning it off and on again?"
DiapDealer is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Too many styles? Ghitulescu Calibre 5 12-12-2014 03:19 PM
<hr /> styles trstill Introduce Yourself 1 05-30-2010 01:57 PM
Reference Lie, Hakon & Bos, Bert: Cascading Style Sheets, level 1. IMP. v1.0 4 Sept 2007 DaleDe IMP Books (offline) 0 09-04-2007 02:12 PM


All times are GMT -4. The time now is 05:21 AM.


MobileRead.com is a privately owned, operated and funded community.