如何在页面顶部添加橙色背景
How to add an orange background to top of page
您好,我想知道是否有人可以告诉我如何在我的文件顶部添加橙色边框。我附上了一张图片,所以你知道我在说什么。
我希望橙色框的高度为 35px。我如何在 css 中创建它?
非常感谢您的帮助。
您只需在页面顶部紧跟 body 标签之后添加以下代码:
HTML
<div id="topframe"></div>
CSS
#topframe {
margin:0;
padding:0;
width:100%;
height:35px;
background:orange;
}
或者,如果您同时想要两者:
<div style="margin:0;padding:0;width:100%;height:35px;background:orange;"></div>
如果您谈论的是背景图片,这就是您需要在 CSS 文件的 正文 中添加的内容:
background-image:url('path/to/your/image.jpg'); // 35px height orange background
background-repeat:repeat-x;
background-position:top;
您好,我想知道是否有人可以告诉我如何在我的文件顶部添加橙色边框。我附上了一张图片,所以你知道我在说什么。
我希望橙色框的高度为 35px。我如何在 css 中创建它?
非常感谢您的帮助。
您只需在页面顶部紧跟 body 标签之后添加以下代码:
HTML
<div id="topframe"></div>
CSS
#topframe {
margin:0;
padding:0;
width:100%;
height:35px;
background:orange;
}
或者,如果您同时想要两者:
<div style="margin:0;padding:0;width:100%;height:35px;background:orange;"></div>
如果您谈论的是背景图片,这就是您需要在 CSS 文件的 正文 中添加的内容:
background-image:url('path/to/your/image.jpg'); // 35px height orange background
background-repeat:repeat-x;
background-position:top;