Home > Article > Web Front-end > How to remove borders from input
In CSS, you can use the border attribute to remove the border. You only need to set the "border:none" style to the input element. The border attribute sets all border attributes. When the value is none, it means that the border attribute is not set for the label element or the border attribute is cancelled, and a borderless style is defined.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Create a new html file and name it test.html. In the test.html file, use the input tag to create a text input box. The default value is empty. Add a class attribute myttpp to the input element to set its css style through this class. Write the tag, and the CSS style of the page will be written in this tag.
<body> <input type="text" name="" class="myttpp"> </body>
In the css tag, set the input style through class (myttpp), and define the border attribute as none to achieve border removal. In order to display the effect, also set the background color to gray.
<style> .myttpp{ border: none; background: #ccc; } </style>
Open the test.html file in the browser to check the effect.
Recommended learning: css video tutorial
The above is the detailed content of How to remove borders from input. For more information, please follow other related articles on the PHP Chinese website!