<h2> MyTitle </h2>
I need to put a background-image to MyTitle text but only to MyTitle text.
I dont want any background in the <h2></h2> element.
Is there a way to do that in css?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Code:
Demo: http://jsbin.com/abitek
This is an example with a simple background color, but of course you could use
background-imageas well.See Displaying hidden elements like
<head>using CSS.Edit now that OP mentioned he meant a heading (e.g.
<h1>) and not a<title>:The key is to use
display: inlineordisplay: inline-block.Code:
Demo: http://jsbin.com/ekusad
Again, this is an example with a simple background color, but of course you could use
background-imageas well.