Wrap around headings
Trying to do it in a single element
HTML
<article>
<h1>Main heading</h1>
<p>Sub text with some really long content just to be sure.</p>
<h1>Main<br>heading</h1>
<div><p>Sub text with some really long content just to be sure.</p></div>
<h1>Main<br>heading<br>again</h1>
<p>Sub text with some really long content just to be sure.</p>
</article>
CSS
body {
background-color: #CCC;
font: 1em/1.2 Tahoma, Arial, sans-serif;
margin: 1em;
}
article {
background-color: #FFF;
margin: 0 auto;
padding: 20px 20px 50px;
width: 960px;
}
h1 {
/* Generate the gradient so it loads quickly and scales with the heading
http://www.colorzilla.com/gradient-editor/ */
background: #0558b1;
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzA1NThiMSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxMDIxOGIiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #0558b1), color-stop(100%, #10218b));
background: -webkit-linear-gradient(top, #0558b1 0%, #10218b 100%);
background: -moz-linear-gradient(top, #0558b1 0%, #10218b 100%);
background: -ms-linear-gradient(top, #0558b1 0%, #10218b 100%);
background: -o-linear-gradient(top, #0558b1 0%, #10218b 100%);
background: linear-gradient(to bottom, #0558b1 0%, #10218b 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0558b1', endColorstr='#10218b', GradientType=0);
color: #FFF;
font-size: 1.4em;
font-weight: bold;
margin: 1em 0 1em -30px;
/*overflow: hidden;*/
/* Make sure the heading had padding-right enough for a few lines of the
slant and ensure that the position is relative - do not add left and top
values! */
padding: 5px;
padding: 5px 150px 5px...