Using PHP to affect CSS line return attributes.

Using PHP to affect CSS line return attributes.

I was looking at this page and really liking the CSS black background they have on the title.

It seems to me there must be a way to use PHP to dictate that when the line breaks, the CSS background will put set the left margin to the larger size like at the beginning and end of the title.

Anyone want to give it a try?

PHP doesn’t know where the line breaks

Let me just remove that bit of spam you left… Sure you didn’t mean to add something stupid, to make it look like you weren’t after the spam in the first place.

I figured it out. It’s solely CSS in nature.

.l-article header h1.entry-title {
font: 45px/58px “TitlingGothicFBCond-Standard”, Arial, Helvetica, sans-serif;
font-weight: normal;
letter-spacing: 1px;
background-color: #4c8db0;
color: #fff;
padding: 0px 10px;
display: inline;
-webkit-box-decoration-break: clone;
-ms-box-decoration-break: clone;
-o-box-decoration-break: clone;
box-decoration-break: clone;
text-decoration: none;
}

Sponsor our Newsletter | Privacy Policy | Terms of Service