Home > Article > Web Front-end > How to hide text box in css
The way to hide a text box in css is to add the display attribute to the text box and set the attribute value to none. The display attribute is used to specify the type of box that the element should generate.
The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.
We only need to enter the code, pass style="display:none ;" is hidden and does not occupy the space, as shown in the figure below
At this time, when we open the page in the browser, we can see that the text box is hidden and does not occupy the space. Position, as shown below:
# The display attribute specifies the type of box the element should generate.
Attribute value:
none This element will not be displayed.
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> p {display:inline} </style> </head> <body> <p>这两个段落生成内联盒子,和它的结果</p> <p>这两个元素之间没有距离。</p>
Related video sharing: css video tutorial
The above is the detailed content of How to hide text box in css. For more information, please follow other related articles on the PHP Chinese website!