Home > Web Front-end > CSS Tutorial > How to put an image at the bottom with css

How to put an image at the bottom with css

WBOY
Release: 2021-12-10 15:35:46
Original
11479 people have browsed it

Method: 1. Use the position attribute to set the picture element to a fixed positioning style. The syntax is "picture element {position:fixed;}"; 2. Use the bottom attribute to fix the picture element with a fixed positioning style. The bottom is enough, and the syntax is "picture element {bottom:0;}".

How to put an image at the bottom with css

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

How to put a picture at the bottom in css

In css, you can use the position attribute to set the picture element to a fixed positioning style , and then use the bottom attribute to set the distance between the picture element and the bottom to 0, so that the picture can be fixed at the bottom.

When the value of the position attribute is fixed, the element will be set to a fixed positioning style.

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>
  <style>
  img{
    position:fixed;
    bottom:0;
  }
  </style>
</head>
<body>
  <img src="1118.02.png" alt="">
</body>
</html>
Copy after login

Output result:

How to put an image at the bottom with css

##(Learning video sharing:

css video tutorial

The above is the detailed content of How to put an image at the bottom with css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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