I’m trying to style the ampersand here to be a nice Baskerville italic font, as I have done with the span within the <p>. It’s not working. Here’s the html snippet & css:
<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“UTF-8”>
<title>AMP test</title>
<link rel=“stylesheet” href=“test.css”>
</head>
<body>
<p>Articles <span class=“amp”>&</span> Events.</p><!-- Works fine –>
<h1>Articles <span class=“amp”>&</span> Events.</h1><!-- Font does not change –>
</body>
</html>
I stuck the rather crude green background in there to check that CSS was indeed being applying to the span inside the H1 - which it is. Just refuses to change the ampersand to the nice one!
Is there a quirk whereby you cannot amend this type of property inside a heading? Seems really strange to me.
The ampersand in both should look like it does for the span within the paragraph tag - it doesn’t style that way in the h1. The font-family: Baskerville and font-style: italic are being overridden / ignored.
I’ve checked it in Safari, Firefox, and Chrome - same issue across all three.