Hi Guys,
I have this odd issue. I’d like a <h1> title to have a background color with some padding. This CSS works flaweless with an tag:
padding:5px 50px;
background:#fff;
border: solid 4px #0054a4;
-webkit-border-radius: 15px!important;
-moz-border-radius: 15px!important;
border-radius: 15px!important;
But when I add this rule to a <h1> tag it takes the whole width of the text block instead of the with of the title itself. I could give it a width of 50% but that wouldn’t do the trick because not all the titles have the same length.
Thanks in advance!
Steven
Hi Steven,
Please try this CSS instead:
h1.paginatitel_vervolg2021 {
font-size: 60px;
font-family: 'Dosis', sans-serif;
font-weight: 600;
text-transform: none!important;
color: #fff;
padding: 20px 40px!important;
background: #0054a4!important;
-webkit-border-radius: 10px!important;
-moz-border-radius: 10px!important;
border-radius: 10px!important;
display: initial;
}
Best regards,
Rikard
Hi Rikard,
Works, thanks! Never heard of that rule though ;)
Regards,
Steven