css - How prevent h2 content from breaking in :before content? -


http://i.imgur.com/wsfucxd.png

yeah have little problem :before icon.

what want h2 content on horizontal line , not after line break under :before content.

any suggestions?

use position:absolute;left:0; icon , add padding-left size of icon h2. note: don't forget set position of h2 relative.

example:

h2{     position: relative;     padding-left: 60px; /* size of icon plus spacer */ } h2:before{     content:'';     position:absolute;     left:0;     height: 50px;   /* height of icon */     width:50px;     /* width of icon */     background-image:url(img/icon.png); /* icon */ } 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -