<html> <head> <title></title> </head> <body> <h1>登录页面</h1> @using (Html.BeginForm("SignIn", "Part3", FormMethod.Post, new { id = "MyForm", name = "MyForm" })) { <p>用户名:@Html.TextBox("userName","",new{onblur="CheckUserName()",placeholder="请输入您的账号"})</p> <p>密码:@Html.TextBox("password","",new{onblur="CheckPassword()",placeholder="请输入您的密码"})</p> <input type="button" class="btn-success" value="登录" /> } </body> </html>
时间: 2023-07-19 19:37:22 浏览: 46
这是一个HTML代码片段,用于创建一个简单的登录页面。其中:
- `<head>` 标签中的 `<title>` 标签用于定义页面的标题;
- `<body>` 标签中的 `<h1>` 标签用于定义页面的标题;
- `@using` 语句用于定义一个表单,并指定表单要提交到的控制器和动作;
- `Html.TextBox()` 方法用于创建文本框,第一个参数是文本框的名称,第二个参数是文本框的默认值,第三个参数是一个匿名对象,用于指定文本框的属性,例如 `onblur` 用于指定在文本框失去焦点时要执行的 JavaScript 函数,`placeholder` 用于指定文本框的占位文本;
- `<input>` 标签用于创建一个提交按钮,`type` 属性指定按钮的类型为“button”,`class` 属性指定按钮的样式为“btn-success”,`value` 属性指定按钮的文本为“登录”。
此外,代码片段中还有两个 JavaScript 函数 `CheckUserName()` 和 `CheckPassword()`,用于验证用户名和密码是否符合要求。
相关问题
<html> <head><title>400 Bad Request</title></head> <body> <center><h1>400 Bad Request</h1></center>
以下是一个示例的HTML代码,展示了一个400 Bad Request错误页面:
```html
<!DOCTYPE html>
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<center>
<h1>400 Bad Request</h1>
</center>
</body>
</html>
```
这段代码会在浏览器中显示一个标题为"400 Bad Request"的页面。页面内容居中显示,使用`<h1>`标签来定义标题。
<body></body>
<body></body>是HTML中的标签,用于定义HTML文档的主体部分。在<body></body>标签中,可以包含网页的内容,例如文本、图像、链接等。以下是一个简单的例子:
```html
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<h1>Welcome to My Webpage</h1>
<p>This is the main content of my webpage.</p>
<img src="image.jpg" alt="My Image">
<a href="https://www.example.com">Visit Example Website</a>
</body>
</html>
```
在上面的例子中,<body></body>标签包含了网页的主要内容,包括一个标题(<h1>标签)、一个段落(<p>标签)、一张图片(<img>标签)和一个链接(<a>标签)。