Html 在没有 body.backround 的自定义博客模板中更改背景

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25006452/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:22:12  来源:igfitidea点击:

Change background in custom blogger template that hasn't body.backround

htmlcsstemplatesbackgroundblogger

提问by user3005638

I have custom Galauness template on blogger (http://nethoroskop.blogspot.com) but I would like to upload my own image...Can you tell me how? In html code there is NOT

我在博主 ( http://nethoroskop.blogspot.com)上有自定义的 Galauness 模板,但我想上传我自己的图片...你能告诉我怎么做吗?在 html 代码中没有

body{ background

There a lot of other backgrounds (like post background,total-wrapper background, lightbox-container-image-data-boxbackground,etc) but not body.backgroundat all!

还有很多其他的backgroundS(像post backgroundtotal-wrapper backgroundlightbox-container-image-data-boxbackground等),但不是body.background在所有!

回答by Usman Khawaja

You need to find and edit this section to add your own background image:

您需要找到并编辑此部分以添加您自己的背景图片:

body {
  background: #ffffff;
  background-image: url(http://i1273.photobucket.com/albums/y417/trynitezoo/winterpaper_zps5a2f39a3.jpg);
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  width: 100%;
  margin: 0;
}

or you can override the background image. You only need to copy and paste the following code in the header tag section and replace the YOUR NEW IMAGE PATH to the image url you needed:

或者您可以覆盖背景图像。您只需将以下代码复制并粘贴到标题标签部分,并将您的新图片路径替换为您需要的图片网址:

<style>
  body {
    background-image: url('http://YOUR NEW IMAGE PATH') !important;
  }
</style>

回答by Brett Holmes

If you want to change the background of the body to an image this would be the best way. Change the <body>to this:

如果您想将身体的背景更改为图像,这将是最好的方法。改成<body>这样:

<body background="image.jpg">

Tutorial from : http://www.w3schools.com/tags/att_body_background.asp

教程来自:http: //www.w3schools.com/tags/att_body_background.asp