Home  >  Article  >  Web Front-end  >  How to remove borders from input

How to remove borders from input

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-21 15:21:2010701browse

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.

How to remove borders from input

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.

How to remove borders from input

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!

Statement:
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