". The readonly attribute is used to specify that the input field is read-only, which prevents users from modifying the value."/> ". The readonly attribute is used to specify that the input field is read-only, which prevents users from modifying the value.">

Home >Web Front-end >Front-end Q&A >How to set readonly in css/html

How to set readonly in css/html

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-15 10:32:023023browse

In css/html, it can be set by using the readonly attribute inside the input or textarea tag, such as "". The readonly attribute is used to specify that the input field is read-only, which prevents users from modifying the value.

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

<html>
<body>
<form action="/example/html/form_action.asp" method="get">
  <p>姓名:<input type="text" name="email" /></p>
  <p>国家:<input type="text" name="country" 
  value="China" readonly="readonly" /></p>
  <input type="submit" value="Submit" />
</form>
<p>请在提交按钮上单击,输入会发送到服务器上名为 "form_action.asp" 的页面。</p>
</body>
</html>

Running results:

How to set readonly in css/html

Recommended learning: css video tutorial

The above is the detailed content of How to set readonly in css/html. 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
Previous article:How to compress css filesNext article:How to compress css files