How do I write text over a image?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am creating a homepage template and have images that I would like to overlay with text so they are editable to the user. Is there a simple way to do this? Example, if I have a blue square image imported and would like to write text in the box.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not really a simple situation. Here's a link to the W3Schools page where the process is demonstrated. Tryit Editor v3.6
Essentially, you have a <div> for text nested within a <div> for the image. The <div> with text is styled to use absolute locations for the text within a <div> styled to accept relative locations. This example also shows the image being styled to be partially transparent. Other CSS for images at CSS Styling Images.
You'll have to use the styles inline (<div style="">) and I'm not sure any of this styling will survive the TinyHTML editor once you save, though.
It might easier to use a <div> with a background-color styled in and then include the text. That will work with solid colors.
Another consideration is text contrast over the image/color - keep accessibility in mind.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.