在html中,可以利用style属性和“background-repeat”属性设置图片不平铺,语法为“<element style="background-repeat:no-repeat;">”。
本教程操作环境: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中怎样让图片不平铺的详细内容,更多请关注AdminJS其它相关文章!
声明:本文仅供个人学习使用,来源于互联网,本文有改动,本文遵循[BY-NC-SA]协议, 如有侵犯您的权益,请联系本站,本站将在第一时间删除。谢谢你