How to add a horizontal line under the image in html

青灯夜游
Release: 2022-01-21 16:59:11
Original
8549 people have browsed it

In HTML, you can use the border-bottom attribute to add a horizontal line under the image. This attribute can set the bottom border style for the image element, thereby achieving the effect of adding an underline. The syntax "picture element { border-bottom: horizontal line thickness solid horizontal line color;}".

How to add a horizontal line under the image in html

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

In HTML, you can use the border-bottom attribute to add a horizontal line under the image.

The border-bottom attribute can add a bottom border to an element and set the size, style and color of the bottom border.

Example:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<style>
			.img{
				border-bottom: 3px solid black;
			}
		</style>
	</head>

	<body>
		<img  src="img/1.jpg"    style="max-width:90%" / alt="How to add a horizontal line under the image in html" >
		<img  src="img/1.jpg"    style="max-width:90%" class="img" / alt="How to add a horizontal line under the image in html" >
	</body>

</html>
Copy after login

How to add a horizontal line under the image in html

Related recommendations: "html video tutorial"

The above is the detailed content of How to add a horizontal line under the image 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