在html中,可以利用style属性和“background-repeat”属性设置图片不平铺,语法为“561979cb07c10b82a6e9b7d310941d2c”。
本教程操作环境:windows10系统、html5版、dell g3电脑。
html中怎样让图片不平铺
在html中想要让图片不平铺,需要利用到style属性和background-repeat属性。
style属性用于设置元素的样式,background-repeat属性用于定义图片的平铺模式,当设置background-repeat:no-repeat样式时,图片就会不平铺。
示例如下:
<!doctype html><html lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>document</title></head><body style="background:url(1118.02.png); background-repeat:no-repeat;"></body></html>
输出结果:
推荐教程:《html视频教程》
以上就是html中怎样让图片不平铺的详细内容。