JSFiddle - React, Tailwind, and code Playground
HTML
<!doctype html>
<html>
<head>
<title>CSS Brain Teaser</title>
<!--
Un exercice rigolo proposé par HTeuMeuLeu
http://www.hteumeuleu.fr
-->
</head>
<html>
<h1>
<span>
<span>Du texte HTML dynamique sur plusieurs lignes avec un fond qui suit bien et des marges autour.</span>
</span>
</h1>
</html>
</html>
CSS
body {
padding:50px;
background:#2fa7ca;
}
h1 {
overflow: hidden;
display: inline-block;
position: relative;
width: 450px;
padding: 5px 0;
font: bold 36px/46px sans-serif;
letter-spacing: -1px;
color: #000;
padding-left: 40px;
}
h1:before {
content: '';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 40px;
background: #fff;
}
h1 > span {
position: relative;
padding: 10px 0;
background: #fff;
}
h1 span span {
position: relative;
left: -20px;
}