css 我在获取背景图像时遇到问题,无法正确对齐到我的页面[关闭]

vof42yt1  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(68)

**已关闭。**此问题需要debugging details。目前不接受回答。

编辑问题以包括desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将帮助其他人回答问题。
8天前关闭。
Improve this question

body {
    margin: 0;
    padding: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-image: url(ramen1.jpg);
    background-color: #cc5e3d;
}

个字符
我一直在工作的第一个网页。我在学习HTML/CSS。我有一个问题,我可能不应该有,但我需要帮助。
我正在尝试将背景图像应用到。请参见下图。原始图像看起来像(A)。我正在尝试将其定位为像(B)。Images of what I am attemting
原来的图片很大。我已经在GIMP中调整了大小。我已经在CSS中尝试了很多不同的东西,但我没有列出它们,你会如何实现它?我会让你知道我是否尝试过,结果是什么。正如我所说,我是新的,但我知道“背景位置”,“大小”和“不重复”等。
非常感谢

zz2j4svz

zz2j4svz1#

我已经看到你的形象,肯定你可以尝试这个css给予形象类形象

.image {
  float: left; /* Align the image to the left */
  max-width: 300px; /* Set the maximum width of the image */
  height: auto; /* Maintain the aspect ratio of the image */
  margin-right: 20px; /* Add some margin to the right for spacing */
}

字符串

相关问题