怎么使背景图片全网页显示

2025-05-22 08:20:55

1、添加style标签:<style type="text/css" ></style>

怎么使背景图片全网页显示

2、添加选择器,例如:<style type="text/css" >body { }</style>

怎么使背景图片全网页显示

3、添加图片路径,例如:<style type="text/css" >body {background-image:url("/images/background.jpg"); }</style>

怎么使背景图片全网页显示

4、取消图片的重复排列:<style type="text/css" >body {background-image:url("/images/background.jpg");background-repeat:no-repeat ; }</style>

怎么使背景图片全网页显示

5、设置背景图片大小:<st鲻戟缒男yle type="text/css" >body {background-image:ur造婷用痃l("/images/background.jpg");background-repeat:no-repeat ;background-size:100% 100%; }</style>

怎么使背景图片全网页显示

6、固定图片:<style type="text/css" >body {background-image:url("/images/background.jpg");background-repeat:no-repeat ;background-size:100% 100%;background-attachment: fixed; }</style>

怎么使背景图片全网页显示
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢