I have an h1 tag in which I want to apply a background color, with the max-width property. But the background color should not be applied based on content width. Can anyone help to resolve this?
Current output:
Expected output: Should remove red mark background color without changing the HTML content(in css with max-width property). Use only css:
h1 {
background-color: yellow;
max-width: 200px;
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>This paragraph testing 123</h1>
</body>
</html>