Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 居中我的头衔_Css - Fatal编程技术网

Css 居中我的头衔

Css 居中我的头衔,css,Css,-在页面底部,我有一个div,其中包含草的图像。如何使草地图像在页面上水平居中 好的,我把它放在中间了 现在我需要在页面上向下移动它 谢谢在CSS中添加以下内容 background-position:center top; margin:auto; 对下列事项: #title{ width:940; height:145px; display:block; background-image:url(images/header.jpg) } 此外,还可以添加以下内容 bac

-在页面底部,我有一个div,其中包含草的图像。如何使草地图像在页面上水平居中

好的,我把它放在中间了 现在我需要在页面上向下移动它


谢谢

在CSS中添加以下内容

background-position:center top;
margin:auto;
对下列事项:

#title{
  width:940;
  height:145px;
  display:block;
  background-image:url(images/header.jpg)
}
此外,还可以添加以下内容

background-position:center top;
margin:auto;

但是,如果您只是希望背景图像(草地图像)居中,则可能不需要这样做

background-position:center top;
margin:auto;
对下列事项:

#title{
  width:940;
  height:145px;
  display:block;
  background-image:url(images/header.jpg)
}
此外,还可以添加以下内容

background-position:center top;
margin:auto;

但是,如果您只是希望背景图像(草地图像)居中,则可能不需要这样做。

如果您提供的是相关代码而不仅仅是一个链接,则会更有帮助。如果您提供的是相关代码而不仅仅是一个链接,则会更有帮助。#title{background image:url(imgs/new#neighborrow.png);背景位置:中上;显示:块;高度:145px;宽度:940px;}我用firebug检查过,它仍然在左边--我试试自动边缘--谢谢!这是错误的
#标题
声明。你不是在说以
header.jpg
为背景的那个吗?好的,我把它放在中间,并确定了正确的声明。。。但是现在如果我试着用页脚把它放在底部,它会把一切搞砸吗?提前感谢不确定该网站是否用于我正在学习的这类小东西-我一定要通读常见问题解答和最佳实践-谢谢如果问题得到解决,你应该接受我的回答。如果您有新问题,您应该创建一个新问题:)#标题{背景图像:url(imgs/new#neighborrow.png);背景位置:中上;显示:块;高度:145px;宽度:940px;}我用firebug检查过,它仍然在左边--我会尝试自动合并--谢谢!这是错误的
#标题
声明。你不是在说以
header.jpg
为背景的那个吗?好的,我把它放在中间,并确定了正确的声明。。。但是现在如果我试着用页脚把它放在底部,它会把一切搞砸吗?提前感谢不确定该网站是否用于我正在学习的这类小东西-我一定要通读常见问题解答和最佳实践-谢谢如果问题得到解决,你应该接受我的回答。如果有新问题,应创建新问题:)