How to add text on image in ReactJS?

I learning ReactJS. Today i decided create my own blog. For header needs image with some text. And when trying add text on image, text slides down.I need to my text position will be at center

[enter image description here] 1

Code:

Header.tsx

import React from "react";
import './header.scss'

const Header = () => {
  return (
    <header>
      <div className = "head-text">
        <div className = "head-image">
          <img src = {require ('../ images / Header.png')} alt = "Freedom Blog" />
        </div>
          <h3> Welcome to my Blog </h3>
          <p> FREEEEDOM </p>
      </div>
    </header>
  )
}


export default Header;

Header.tsx

import React from 'react';
import Header from './components/Header';
import './index.scss'

const App = () => {
  return (
    <>
      <Header />
    </>
  );
}

export default App;

css files are empty, so i didn't added them



Read more here: https://stackoverflow.com/questions/64400365/how-to-add-text-on-image-in-reactjs

Content Attribution

This content was originally published by Freedom Essence at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: