Home > Web Front-end > CSS Tutorial > How to Remove Outlines and Borders from Hyperlinked Images?

How to Remove Outlines and Borders from Hyperlinked Images?

Susan Sarandon
Release: 2024-11-19 03:08:03
Original
588 people have browsed it

How to Remove Outlines and Borders from Hyperlinked Images?

Eliminating Outlines Around Hyperlinked Images

When utilizing CSS Text Replacement along with negative text-indent values (e.g., text-indent:-9999px), a dotted line may appear around clickable links, as illustrated below.

[Image of a dotted line surrounding a link]

Solution:

To resolve this issue, employ the following CSS properties:

Remove Outline for Anchor Tags:

a {
  outline: none;
}
Copy after login

Remove Outline from Image Links:

a img {
  outline: none;
}
Copy after login

Remove Border from Image Links:

img {
  border: 0;
}
Copy after login

By implementing these styles, you can effectively eliminate the unwanted outlines and borders around hyperlinked images, ensuring a seamless and aesthetically pleasing browsing experience.

The above is the detailed content of How to Remove Outlines and Borders from Hyperlinked Images?. For more information, please follow other related articles on the PHP Chinese website!

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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template