Home > Web Front-end > Front-end Q&A > How to prevent images from being tiled in html

How to prevent images from being tiled in html

WBOY
Release: 2021-12-20 10:07:37
Original
7365 people have browsed it

In HTML, you can use the style attribute and the "background-repeat" attribute to set the image to not be tiled. The syntax is "".

How to prevent images from being tiled in html

The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.

How to make pictures not tiled in html

If you want to make pictures not tiled in html, you need to use the style attribute and background-repeat Attributes.

The style attribute is used to set the style of the element, and the background-repeat attribute is used to define the tiling mode of the image. When the background-repeat:no-repeat style is set, the image will not be tiled.

The example is as follows:

<!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>
Copy after login

Output result:

How to prevent images from being tiled in html

Recommended tutorial: "html video tutorial

The above is the detailed content of How to prevent images from being tiled in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template