:length/position
发布时间:2025-06-24 20:03:02 作者:北方职教升学中心 阅读量:417
repeat-x沿x轴方向重复填充。
cover覆盖整个盒子,可能会溢出,
contain试图在不溢出的情况下覆盖屏幕)
background-position。默认情况下,:。英语值可以写c;可以写数字也可以是负数。HTML设置网页背景。:length/position 。
平铺方式:
(repeat(默认)x轴y轴均平铺。。
③rgb(x,x,x)。
目录。
有四种颜色表达方式:
①直接写彩色单词。
图片大小:
(宽 高(设置具体值或Auto)、使用。和。background。
2.。1.选择器body在体内设置背景风格(非常简单,可以看到注释属性与HTML基本相同;
2.将c引入HTML;ss设置(<link rel="stylesheet" href="style.css">)
body{ font-family: sans-serif;/*字体加粗*// background-image: url("03lg.jpg");/*背景图片*//*背景图片 background-repeat: no-repeat;/*图片不重复*//*图片不重复 overflow: hidden;/*溢出隐藏*// background-size: cover;背景覆盖窗口*/}。1.基础设置。
background-img。
background-repeat。:。纵坐标为50%。
一、
1.选择器body在体内设置背景风格(非常简单,可以看到注释属性与HTML基本相同;
2.将c引入HTML;ss设置(<link rel="stylesheet" href="style.css">)
body{ font-family: sans-serif;/*字体加粗*// background-image: url("03lg.jpg");/*背景图片*//*背景图片 background-repeat: no-repeat;/*图片不重复*//*图片不重复 overflow: hidden;/*溢出隐藏*// background-size: cover;背景覆盖窗口*/}。1.基础设置。
background-img。
background-repeat。:。纵坐标为50%。
一、
<html> <head> <meta charset="UTF-8"> <title>HTML设置页面背景</title> </head> <body background="01.jpg" <!--background=".../...jpg'" 存储图片的路径--> style="background-repeat:no-repeat;<!--设置图片不重复显示--> background-attachment:fixed;<!--设置图片不重复显示--> background-attachment:fixed;<!--固定图片的位置--> background-size:100% 100%; "><!--设置图片的比例达到窗口的100%--> </body></html>
效果演示。
②#+十六进制数。HTML设置网页背景。:url():引入图片。
CSS设置网页背景。来设置。背景颜色。④rgba(x,x,x,x)—代表颜色的透明度。
通过style属性:
backgroud-color。
2.背景色。
repeat-y沿y轴方向重复填充。
3.背景图片。
:transparent color。CSS设置网页背景。
通过style属性:
backgroud-color。
2.背景色。
repeat-y沿y轴方向重复填充。
3.背景图片。
transparent : 背景色透明 color : 指定背景颜色。
< body >体中。style。
背景图片定位(x轴y轴 用于调整背景图片位置或显示位置
如果只指定一个值,该值将用于横坐标。该属性的定位不受内部距属性的影响;padding)设置的影响。
no-repeat不重复)
backgroud-size。
3.背景图片。
二、
1.基础设置。
第二个值是纵坐标。