Home > Web Front-end > Front-end Q&A > What is the code for css not showing blue border?

What is the code for css not showing blue border?

藏色散人
Release: 2023-01-31 09:28:24
Original
993 people have browsed it

The css code for not displaying blue borders is "img {border:0;onfocus="this.blur()"}"; where border is the abbreviation of the border attribute, which is used to specify the style and width of the element border. and color; the attributes that can be set are "border-width", "border-style" and "border-color" respectively.

What is the code for css not showing blue border?

The operating environment of this tutorial: Windows 10 system, CSS3 version, DELL G3 computer

What is the code for css not to display the blue border?

css Remove the blue border from the edge of the photo

In css, when writing code, the path to the photo is usually inserted, but when opening the website on the web page, , you will find that there is a blue border on the edge of the photo, which cannot be removed no matter how you refresh it. Now let’s talk about some cases:

The code to insert the picture is

<img src=""/>
Copy after login

which is the first in css Insert the code

divimg {border:0;}  
Copy after login

if it still doesn’t work and add

onfocus="this.blur()" 
Copy after login

The final result is:

img {border:0; onfocus="this.blur()"}
Copy after login

border Introduction:

border Yes Shorthand property for the border property.

CSS border property is used to specify the style, width and color of the element border.

The properties that can be set are (in order): border-width, border-style and border-color.

You can also set only one value. For example, border: #FF0000; is correct, and other values ​​will be set to the initial values ​​of the corresponding attributes.

Syntax format

The border attribute can be specified using one, two, or three of the values ​​listed below. The order of the values ​​does not matter:

/* 边框样式 */
border: solid;
/* 边框宽度 | 边框样式 */
border: 2px dotted;
/* 边框样式 | 边框颜色 */
border: outset #f33;
/* 边框宽度 | 边框样式 | 边框颜色 */
border: medium dashed green;
/* 全局值 */
border: inherit;
border: initial;
border: unset;
Copy after login

Note: If the border's style is undefined, it will not be visible. This is because styles default to none.

Recommended learning: "css video tutorial"

The above is the detailed content of What is the code for css not showing blue border?. 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