Skip to main content

Text over Image using CSS

 


    In this tutorial, we'll learn how to add text over an image using CSS. We'll cover how to position the text and style it to make it stand out against the image. Whether you're a beginner looking to learn CSS or a experienced developer looking to brush up on your skills, this tutorial is for you! By the end of the tutorial,  you'll be able to add text over images like a pro. So let's get started.


text_over_image.html

  <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title>Text Over Image</title>
            <link rel="stylesheet" href="css/text_over_image.css">
            <link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
        </head>
        <body>
            <div class="content-wrapper">
                <img src="image/sample.jpg">
                <div class="text-wrapper">
                    <h1>Sample Text</h1>
                </div>
            </div>
        </body>
    </html>

text_over_image.css

  *{
      padding: 0;
      margin: 0;
  }

  body{
      width: 100%;
      height: auto;
      overflow: hidden;
      background-color: #c4a1a2;
  }

  .content-wrapper{
      width: 80%;
      margin: 4% 10% 5% 10%;
  }

  .content-wrapper img{
      width: 100%;
  }

  .text-wrapper{
      width: 100%;
      position: relative;
      margin-top: -40%;
  }

  .text-wrapper h1{
      text-align: center;
      color: #ffffff;
      font-size: 10vw;
      font-family: 'lobster', cursive;
  }

Watch Full Tutorial Video Here!

Comments

Popular posts from this blog

Auto Image Slider using CSS Only

     Are you ready to learn how to create an image slider using only CSS? Look no further! In this tutorial, we'll walk you through the step-by-step process of building a sleek and modern image slider using HTML and CSS. No JavaScript required! In this tutorial We'll cover setting up the HTML structure for the slider.       This will include creating the container element and styling the slider with CSS. You'll also learn how to add transitions and animations to create a smooth sliding effect. By the end of this tutorial, you'll have a fully functional image slider that you can use on your own website. Whether you're a beginner or an experienced developer, this tutorial has something for you. So let's get started creating your own image slider using CSS today! index.html <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/style.css"...

Image with Accordion Effect on Hover using CSS and HTML

     Hey there, folks! Are you looking to jazz up your website's image galleries? Well, you've come to the right place! In this tutorial, we'll show you how to create an image with accordion effect on hover using HTML and CSS. First off, let's chat about HTML and CSS. HTML is like the building blocks of web pages, while CSS adds style and personality to your website.       By combining these two, you can create some seriously cool designs that'll knock your user's socks off!In this tutorial, we're gonna be using CSS animation effects to make an accordion effect on an image when a user hovers over it. It's a slick way to add a bit of movement and interactivity to your web design. To get started, we'll walk you through creating a basic HTML structure for your image.       Then, we'll apply some CSS styles to give it that fancy accordion look. Finally, we'll create a hover effect using CSS animation that'll make your image expand and...

Glass Fill Effect using CSS Only

     In this tutorial, we will be creating a glass fill animation effect without using any SVG graphics or JavaScript. We will be using only CSS to create the animation. This animation is perfect for creating a liquid filling effect on a website. The tutorial is easy to follow and can be implemented on any website. So, if you're looking to add a cool animation effect to your website, this tutorial is for you. With this method, you can create a realistic looking glass fill animation effect without the need for any additional graphics or libraries.  index.html <html> <head> <title>TUTORIAL</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="glass-ctr"> <div class="glass"></div> <div class="water-ctr"> <div class="water"></div> ...