lucky 的学习笔记(我写的致敬页,图片怎么不显示呢?)

lucky 的学习笔记(我写的致敬页,图片怎么不显示呢?)
0

这是 Codepen 链接
这是代码:

<main id="main">
  <h1 id="title">Grandma Moses</h1>
  <p>An American Folk Artist</p>
  <div id="img-div">
    <img id="https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=grandma%20moses&hs=2&pn=1&spn=0&di=11990&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&ie=utf-8&oe=utf-8&cl=2&lm=-1&cs=702272731%2C3500680070&os=890863289%2C3027388171&simid=3144419005%2C3636969884&adpicid=0&lpn=0&ln=30&fr=ala&fm=&sme=&cg=&bdtype=0&oriquery=grandma%20moses&objurl=http%3A%2F%2Fs2.sinaimg.cn%2Fmw690%2F001f0nLrzy79pCA1amZf1%26690&fromurl=ippr_z2C%24qAzdH3FAzdH3Fks52_z%26e3Bftgw_z%26e3Bv54_z%26e3BvgAzdH3FfAzdH3Fks52_9n1db8wla8adxnlb_z%26e3Bip4s&gsm=&islist=&querylist="
      alt="Grandma Moses is painting"
    />
    <p id="img-caption">
      Anna Mary Robertson, also known as Grandma Moses, became widely famous for her nostalgic paintings depicting rural American life.
    </p>
  </div>
  <section id="tribute-info">
    <h3>Who Was Grandma Moses?</h3>
    <p id="text">Grandma Moses was an American artist who spent decades living the rural, agricultural life that she would later feature in her paintings. She only began devoting herself to art when she was in her seventies. In 1938, an art collector discovered her work. Completely self-taught, Moses soon became famous for her images of country life.</p>
    <h3>Farmer, Wife and Mother</h3>
    <p id="text">Born Anna Mary Robertson on September 7, 1860, in Greenwich, New York, Grandma Moses was one of the most famous folk artists of the twentieth century. She grew up as one of ten children on her parents' farm. Leaving home at age 12, Moses went to work as a hired girl for a nearby farm. She married Thomas Moses in 1887, and the pair settled in Virginia’s Shenandoah Valley. There they ran a farm and raised five children together (the couple lost five other children as infants).

In 1905, Moses returned to New York State with her family. She and her husband operated a farm in Eagle Bridge, New York. Moses later began dabbling in painting, creating her first work on a fireboard in her home in 1918. She occasionally painted after that, but she did not devote herself to her craft until much later. Moses suffered a great loss in 1927 with the death of her husband, and she sought ways to keep busy in her grief.</p>
    <h3>Acclaimed Folk Artist</h3>
    <p id="text">By the mid-1930s, Moses, then in her seventies, devoted most of her time to painting. Her first big break came in 1938. She had some of her works hanging in a local store, and an art collector named Louis J. Caldor saw them and bought them all. The following year, Moses had some of her paintings shown at the Museum of Modern Art in New York City in an exhibition of unknown artists. She went on to have her first one-woman show in New York and had her picturesque works displayed at Gimbels, a famous New York department store, the following year.

Moses often drew from her memory for her captivating scenes of rural life. According to the New York Times, she once said that “I’ll get an inspiration and start painting; then I’ll forget everything, everything except how things used to be and how to paint it so people will know how we used to live.” Some of her images, such as “Applebutter Making” (1947) and “Pumpkins” (1959), brightly depict the labors involved in agricultural life. Others, such as “Joy Ride” (1953), showcase a moment of fun and play.
    <br> <br>Sometimes referred to as an American primitive artist because she was self-taught, Moses developed a devoted following. In the mid-1940s, her images were reproduced on greeting cards, which introduced her to a wider audience. Moses won the Women’s National Press Club Award for her artistic achievements in 1949. She went to Washington, D.C., to collect this honor and met with President Harry Truman during her visit. Moses soon switched from the paintbrush to the pen, writing the 1952 memoir My Life’s History.
    </p>
    <h3>Death and Legacy</h3>
    <p id="text">To celebrate her 100th birthday, New York governor Nelson Rockefeller declared September 7, 1960, as “Grandma Moses Day.” He repeated the honor the following year to mark the artist turning 101. By this time, however, Moses was in ill health. She passed away on December 13, 1961, in a medical center in Hoosick Falls, New York.

During her career, Moses created about 1,500 works of art. Her paintings still remain popular today and provide a glimpse into America’s pastoral past. According to an Associated Press report, President John F. Kennedy remembered Moses as “a beloved figure from American life.” He also said that “The directness and vividness of her paintings restored a primitive freshness to our perception of the American scene.”</p>
    <h3>
      Thank <a id="tribute-link" href="https://www.biography.com/artist/grandma-moses" target="_blank">Biography</a> for the infomation.
    </h3>
  </section>
</main>
html {
  font-size: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.6rem;
  line-height: 1.5;
  text-align: center;
  color: #333;
  margin: 0;
}

h1 {
  font-size: 4rem;
  margin-bottom: 10px;
}

@media (max-width: 300px) {
  h1 {
    font-size: 3.5rem;
    line-height: 1.2;
  }
}

a {
  color: dark-blue;
}

#main {
  margin: 30px 8px;
  padding: 15px;
  border-radius: 5px;
  background: #eee;
}
#text{
  text-align: left;
}
@media (max-width: 460px) {
  #main {
    margin: 0;
  }
}

img {
  max-width: 100%;
  display: block;
  height: auto;
  margin: 0 auto;
}

#img-div {
  background: white;
  padding: 10px;
  margin: 10px;
}

#img-caption {
  margin: 10px 10px 10px 10px;
}

@media (max-width: 460px) {
  #img-caption {
    font-size: 1.4rem;
  }
}

这是截图:
image

人物图片怎么不显示呢?

右键点击图片,选择复制图片地址,才是真正的图片网址,你直接使用的是百度图片搜索结果的网页链接

你 img标签 的src 写成 id 了,图片地址也写错了。应该是

<img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1573966516304&di=3de05f0820ad605b4fadcdea27354f24&imgtype=jpg&src=http%3A%2F%2Fn1.itc.cn%2Fimg8%2Fwb%2Frecom%2F2016%2F02%2F17%2F145566638539871937.jpeg"
      alt="Grandma Moses is painting"
    />

是的,src 写成 id 了,我太粗心了!
图片地址按照你们说的,复制图片地址,而不是网址。
谢谢两位 @tomcat @forsky
不过我今天打不开 Codepen,等打开后修改了看看能不能显示哈。

哇,显示啦哈哈哈~~
这是我写的第一个项目,大家还有什么建议都可以给我提呀,我想慢慢地优化这个页面!