网页的背景图片
我是 ASP.NET 的新手。我需要知道如何为我的网页添加背景图片?
I'm new for the ASP.NET. I need to know how to add a background image for my webpage?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我是 ASP.NET 的新手。我需要知道如何为我的网页添加背景图片?
I'm new for the ASP.NET. I need to know how to add a background image for my webpage?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您可以使用 CSS 来完成此操作,这里不需要使用 ASP 进行任何操作。
将以下代码添加到您的
Style.css
文件中,并确保将背景图像的路径更改为真实图像。现在,无论您有多少页,您都只能在一处定义背景图像。将来,您可以通过更改这一行来更改所有网页(引用 CSS 文件)的背景图像。
You can do this with CSS, you don't need to do anything with ASP here.
Add the following code to your
Style.css
file and make sure you change the path to your background image to your real image.Now, no matter how many pages you have, you have your background image defined in only one place. In the future, you can change the background image for all of your web pages (that reference your CSS file) by changing this one line.
如果您想要水平或垂直重复图像,
您可以使用repeat-x或repeat-y
If its an image you want to be repeated horizontal of vertical,
you can use repeat-x or repeat-y