In CSS, you can use the "border-color" attribute to change the border color of img. The function of this attribute is to set the border color of the element. You only need to add "border-color: color value; "Style is enough.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
How to change the border color of img in css
In css, you can use the border attribute to change the border color of img. Let’s look at the example below. The specific operation, the example is as follows:
<html> <style type="text/css"> img{ border-style: solid; border-width: 10px; border-color:red; } </style> <body> <img src="/static/imghwm/default1.png" data-src="/i/eg_tulip.jpg" class="lazy" alt="上海鲜花港 - 郁金香" /> </body> </html>
Output result:
At this time, the img border color is red. Next, we pass the border attribute, The color of the table border can be:
<html> <style type="text/css"> img{ border-style: solid; border-width: 10px; border-color:blue; } </style> <body> <img src="/static/imghwm/default1.png" data-src="/i/eg_tulip.jpg" class="lazy" alt="上海鲜花港 - 郁金香" /> </body> </html>
Output result:
(Learning video sharing: css video tutorial)
The above is the detailed content of How to change the border color of img with css. For more information, please follow other related articles on the PHP Chinese website!

Here's a container with some child elements:

Flyout menus! The second you need to implement a menu that uses a hover event to display more menu items, you're in tricky territory. For one, they should

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."- Tim Berners-Lee

In this week's roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.

The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.

In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties

The IndieWeb is a thing! They've got a conference coming up and everything. The New Yorker is even writing about it:


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment