You might want to check out the following link:
https://css-tricks.com/a-complete-gu...ta-attributes/
It allows you to select based on a tag's attribute and if that attribute has a specific value.
I do not know if Sigil or Calibre supports this QtWebEngine.
Does the "epub" seem to look okay in Sigil and/or Calibre?