View Single Post
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: 3,360
Karma: 20212223
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
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