Two examples:
Code: Select all
span.myEmphasis {
font-weight: bold;
color: var(--textEmphasisColour);
font-size: 10pt; }
.toDoHighlight {
background-color: yellow; }
Code: Select all
span.myEmphasis {
font-weight: bold;
color: var(--textEmphasisColour);
font-size: 10pt; }
.toDoHighlight {
background-color: yellow; }
Thanks. I didn't realise I could do that. I didn't realise em was a tag in its own right, just like p, h1, etc. Coming from a paper docs background, html and css doesn't come naturally to me yet. I'll get there eventually, though.Dave Lee wrote:For best practice, I'd also suggest using the em (emphasis) tag instead of span, since the style is intended to convey some emphasis; e.g. use em.myEmphasis instead of span.myEmphasis.
Good point. I can see the value in that. Although this content (like all my content so far) is PDF only, it's worth me adopting this as good practice. At some point in the future the content might welly be put online as html, so it's worth considering online accessibility upfront to make that transition easier.Dave Lee wrote:Although you might not see a visual difference, accessibility aids will understand the underlying semantic meaning of tags, so they know em means to add emphasis, whereas a span tag is generic with no particular meaning.
Thanks.Nita Beck wrote:The selector that is just the "dot" selector is a generic selector, meaning you can apply it to lists, tables, divs, paragraphs, spans -- anything. But that might not yield the result you expect univerally. If you are trying to define a selector that you'll only ever apply to inline characters, then I suggest you don't use a generic selector but create a custom span selector, such as "span.UILabel" (when you want to show a user interface item with a specific formatting.)