RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
怎么给html设置背景

小编给大家分享一下怎么给html设置背景,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

创新互联是专业的密山网站建设公司,密山接单;提供成都网站建设、成都网站设计,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行密山网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

html设置背景的方法:1、使用body标签的bgcolor属性设置背景颜色;2、使用body标签的background属性设置背景图片;3、在body标签中使用style属性,添加“background:颜色值/url('图片路径')”。

本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。

html设置背景

1、body标签的bgcolor属性

bgcolor 属性规定文档的背景颜色。



 
 


Hello world!

效果图:

怎么给html设置背景

注意:如果使用颜色名,不同浏览器的渲染结构不一样,如果使用RGB代码,火狐浏览器无法显示正确颜色。

提示: 如果所有浏览器要显示相同颜色,要使用十六进制的颜色代码。

2、body标签的background属性

background 属性规定规定文档的背景图像。








效果图:

怎么给html设置背景

3、css background 属性

background属性是一个简写属性,可以在一个声明中设置所有的背景属性。

可以设置的属性分别是:

  • background-color

  • background-position

  • background-size

  • background-repeat

  • background-origin

  • background-clip

  • background-attachment

  • background-image

示例:




 




This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

效果图:

怎么给html设置背景

以上是“怎么给html设置背景”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!


网站标题:怎么给html设置背景
分享URL:http://sczitong.cn/article/gjjpeg.html