Home > Article > Web Front-end > How to remove the right border of an element in css
In CSS, you can use the "border-right" attribute to remove the right border of the element. The function of this attribute is to set the style of the right border of the element. When the value of this attribute is "none", it will To remove the right border of an element, just add the "border-right:none;" style to the element.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
How to remove the right border of an element in css
In css, there is the border-right attribute that can control the right border style of an element. Below we Let's take an example to see how to set the right border of an element through the border-right attribute.
First we create a complete element border, 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> </head> <body> <style type="text/css"> div{ width:250px; height:250px; border:10px solid; border-image: linear-gradient(red,yellow,blue)30 30; } </style> <div></div> </body> </html>
Output result:
Add border- right:none 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> </head> <body> <style type="text/css"> div{ width:250px; height:250px; border:10px solid; border-image: linear-gradient(red,yellow,blue)30 30; border-right:none } </style> <div></div> </body> </html>
Output result:
(Learning video sharing: css video tutorial)
The above is the detailed content of How to remove the right border of an element in css. For more information, please follow other related articles on the PHP Chinese website!