How should you put an image on the left of the heading name?
return (
<div className="header">
<img src={"/images/logo.png"} width="10" height="5" />
<p className="name">heading name</p>
<div className="header-right">
How should you put an image on the left of the heading name?
return (
<div className="header">
<img src={"/images/logo.png"} width="10" height="5" />
<p className="name">heading name</p>
<div className="header-right">
In your header class, which is basically a container for the img, p and div
, add a grid.
.header {
display: grid;
grid-template-columns: 50px 1fr 50px; // This will create 2 columns of 50 pixels, and the middle column will fill the remaining space grid-template-rows: 1fr; // just one row
height: 100%;
width: 100%;
}
return (
<div className="header">
<img src={"/images/logo.png"} width="10" height="5" />
<p className="name">heading name</p>
<div className="header-right">