简体   繁体   中英

background-image with a text

My goal is to get a result like this: 在此处输入图片说明

For now, I would like the text to be in the background image. I think my problem is perhaps in my blocks HTML ?

Here is an overview 在此处输入图片说明

 .background_grey { height: 70px; width: 100%; margin-top: 0px; position: relative; } .page_title { font-size: 14px; } 
 <img class="background_grey" src="images/subtle_grunge.png" /> <div class="page_title">Register <span class="hometxtcolor">an Account</span></div> 

Thank you for your help !

You have to use a background image via CSS, not from an img element:

 .page_title { background-image: url(images/subtle_grunge.png); } 
 <div class="page_title"> Register <span class="hometxtcolor"> an Account </span> </div> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM