Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

can you overlap text onto an image?

Featured Replies

Is it possible to overlap html text onto an image? If so how is it done? I have been agonising over this for a few hours and tried all different types of code, nothing works!

Make a div, put the background of the div as the image. (Make sure you set the divs height and width the same as the images!)

 

Then put the text you want in the div.

 

Like so...

 

<style type="text/css">
#image1 {
   background-image: url('imageurl.png');
   width: 100px;
   height: 100px;
}
</style>

<div id="image1">
   Hello
</div>

I hope that helps.

  • Author

It works!!! You’re a life saver! Been scratching my head over that all day! It was so simple; I thought you could only set a background image for the whole browser window and not individual divs. Well now I know.

 

Thanks :D

Another way you could have approached it is relatively positioning a p tag with a specific class so for example:

 

HTML:

 

<div id="imageHolder">
<img src="blah.jpg" alt="blah"/>
<p class="imageText">Image text</p>
</div>

 

CSS:

 

.imageText { position: relative; top: 50px; left: 50px; } 

 

However, the method previously stated works aswell with the bonus of not having to mess with relative positioning. :D

  • Author

cheers, will keep the other method in mind¡ :)

nice one dt17 i like the second method as well. i knew about the background but positioning is something i enjoy messing around with so it's nice that you share the knowledge!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.