HowTo Home


Icon Bar Menu Icon Accordion Tabs Vertical Tabs Tab Headers Top Navigation Responsive Topnav Side Navigation Fullscreen Navigation Off-Canvas Menu Hover Sidenav Buttons Horizontal Scroll Menu Vertical Menu Bottom Navigation Responsive Bottom Nav Bottom Border Nav Links Fixed Menu Slide Down Bar on Scroll Sticky Navbar Hover Dropdowns Click Dropdowns Dropdown in Navbar Mega Menu Pagination Breadcrumbs Button Group Vertical Button Group


Slideshow Modal Images Lightbox Responsive Image Grid Image Grid Tab Gallery Image Overlay Image Effects Image Text Transparent Image Text Full Page Image Hero Image Rounded Images Meet the Team Flip an Image Shake an Image Portfolio Gallery Portfolio with Filtering


Alert Buttons Animated Buttons Social Media Buttons Loading Buttons Next/prev Buttons Round Buttons Scroll To Top Button


Login Form Signup Form Contact Form Newsletter Responsive Form Clear Input Field Copy Text to Clipboard Animated Search Custom Checkbox/Radio Toggle Switch Password Validation Toggle Password Visibility Multiple Step Form


Filter List Filter Table Filter Elements Sort List Sort Table


Fullscreen Video Modal Boxes Timeline Progress Bars Skill Bar Range Sliders Tooltips Popups Calendar Zebra Striped Table Responsive Tables HTML Includes To Do List Loaders Star Rating User Rating Overlay Effect Contact Chips Cards Profile Card Alerts Notes Labels Circles Coupon Fixed Footer Equal Height Clearfix Snackbar Scroll Drawing Pricing Table Parallax Aspect Ratio Build a Web Site Toggle Like/Dislike Toggle Hide/Show Toggle Class Add Class Remove Class Arrows Shapes Custom Scrollbar Device Look Placeholder Color Vertical Line Animate Icons Countdown Timer Typewriter Coming Soon Page Center Website Thumbnails Chat Messages Testimonials Draggable HTML Element Syntax Highlighter JS Animations


2 Column Layout 3 Column Layout 4 Column Layout Expanding Grid Mixed Column Layout


Google Maps Google Translate Google Charts Google Fonts


Convert Weight Convert Temperature Convert Length Convert Speed

How TO - Position Text Over an Image

Learn how to place text over an image.

Image Text

Bottom Left
Top Left
Top Right
Bottom Right

Try it Yourself »

How To Place Text in Image

Step 1) Add HTML:


<div class="container">
  <img src="img_fjords_wide.jpg" alt="Norway" style="width:100%;">
  <div class="bottom-left">Bottom Left</div>
  <div class="top-left">Top Left</div>
  <div class="top-right">Top Right</div>
  <div class="bottom-right">Bottom Right</div>
  <div class="centered">Centered</div>

Step 2) Add CSS:


/* Container holding the image and the text */
.container {
    position: relative;
    text-align: center;
    color: white;

/* Bottom left text */
.bottom-left {
    position: absolute;
    bottom: 8px;
    left: 16px;

/* Top left text */
.top-left {
    position: absolute;
    top: 8px;
    left: 16px;

/* Top right text */
.top-right {
    position: absolute;
    top: 8px;
    right: 16px;

/* Bottom right text */
.bottom-right {
    position: absolute;
    bottom: 8px;
    right: 16px;

/* Centered text */
.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
Try it Yourself »

To learn more about how to style images, read our CSS Images tutorial.

To learn more about CSS positoning, read our CSS Position tutorial.