Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
87 views
in Technique[技术] by (71.8m points)

javascript - The uploaded image shows up as image icon on html website

I am trying to build my portfolio. I want to add my picture to about me section. Although I do not get any errors, only the image icon shows up on the website

image

and Here is my code for js:

            <div className="about__img">
                <img src="./images/br.jpg" class="me"/>
            </div>

I also tried uploading from image folder by using relative path and this is for css

.me{
  position: relative;
   width: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #f9f7f7;
    padding: 15%;
    border-radius: 50%;
    opacity: 0.7;
    -webkit-transition: border-radius 0.5s, opacity 0.5s;
    transition: border-radius 0.5s, opacity 0.5s;
}
.about__img{
  padding: 100px;

}

.about__img img{
  width: 300px;
  height: 300px;
}

Can somebody please help!! Check this to see where my folders are Files

question from:https://stackoverflow.com/questions/65903182/the-uploaded-image-shows-up-as-image-icon-on-html-website

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is showing that the image file cannot be found, try this:

 <div className="about__img">
                    <img src="../images/br.jpg" class="me"/>
                </div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...