I am building a portfolio site with react js but the photo I am trying to use is not showing up on the web. I cant seem to find the errors so please help me figure out what I could be doing wrong
Here is the code where the image is contained
import Logo from '../../assets/fts_black.png'
const Header = () => {
return (
<header>
<div className="container header__container">
<div className="me">
<img src={Logo} alt="Logo" />
</header>
)
}
export default Header
This is the css code for the image
.me{
background: var(--color-primary);
width: 22rem;
height: 30rem;
position: absolute;
left: calc(50% - 11rem);
margin-top: 4rem;
border-radius: 12rem 12rem 0 0;
overflow: hidden;
padding: 5rem 1.5rem 1.5rem 1.5rem;
}
The styling is working just fine but the photo just doesnt want to show up. Please help
Thank you for your kind assistance, I realised I made a mistake in the root css in index.css by giving the width of 1005 instead of 100%. I'm sorry for the inconvenience, bye
Are you sure that the path to the img location is correct? I am pretty new with React but the code seems fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.