input控件(HTML表单中的单选,多选图像的提交以及提交重置按钮)

input控件:<input>标签拥有多个type属性值,用于定义不同的控件类型。

图像形式的提交按钮:<input type="image"/>

1.单选按钮 

<input type="radio"name="_"/>(单选框)(name的定义前后一致为单选,不一致则为多选)

例:(单选)

(多选)

2.多选按钮

<input type="checkbox">(复选框)

 

(<br>为换行标签)

3.提交按钮(是表单的核心控件,用户完成信息的输入后,一般都需要单击提交按钮才能完成表单数据的提交)

4.重置按钮(当用户的输入信息有误时,取消已输入的所有表单信息。可以对其应用的value属性,改变重置按钮上的默认文本)

<input type="reset"/>

  • 8
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我可以提供一个简单的示例,满足您的要求: HTML 代码: ``` <!DOCTYPE html> <html> <head> <title>网页标题</title> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="script.js"></script> </head> <body> <header> <div class="logo">网站 Logo</div> <nav> <ul> <li><a href="#">首页</a></li> <li><a href="#">商品分类</a></li> <li><a href="#">购物车</a></li> <li><a href="#">登录</a></li> </ul> </nav> <form class="search-form"> <input type="text" placeholder="搜索"> <button type="submit">搜索</button> </form> </header> <main> <div class="banner">轮播图</div> <section class="product-list"> <h2>商品列表</h2> <ul> <li> <img src="product-image.jpg"> <h3>商品名称</h3> <p>商品描述</p> <span class="price">¥99.00</span> <button class="add-to-cart">加入购物车</button> </li> <!-- 更多商品 --> </ul> </section> <aside class="sidebar"> <h2>侧边栏</h2> <ul> <li><a href="#">热门商品</a></li> <li><a href="#">新品推荐</a></li> <li><a href="#">优惠活动</a></li> </ul> </aside> </main> <footer> <div class="footer-nav"> <ul> <li><a href="#">关于我们</a></li> <li><a href="#">联系我们</a></li> <li><a href="#">帮助心</a></li> </ul> </div> <div class="social-media"> <a href="#"><img src="wechat-icon.png"></a> <a href="#"><img src="weibo-icon.png"></a> <a href="#"><img src="qq-icon.png"></a> </div> <div class="copy-right"> <p>版权信息</p> </div> </footer> </body> </html> ``` CSS 代码: ``` body { font-family: Arial, sans-serif; margin: 0; padding: 0; } header { background-color: #333; color: #fff; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 10px; } .logo { font-size: 24px; font-weight: bold; } nav ul { list-style: none; margin: 0; padding: 0; display: flex; } nav ul li { margin-right: 20px; } nav ul li a { color: #fff; text-decoration: none; } .search-form { display: flex; align-items: center; } .search-form input[type="text"] { padding: 5px; border-radius: 5px; border: none; } .search-form button[type="submit"] { padding: 5px; border-radius: 5px; border: none; background-color: #f90; color: #fff; margin-left: 10px; cursor: pointer; } .banner { background-image: url(banner.jpg); background-size: cover; background-position: center; height: 200px; } .product-list { display: flex; flex-wrap: wrap; align-items: flex-start; } .product-list h2 { font-size: 24px; margin: 20px 0; } .product-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; } .product-list li { margin-right: 20px; margin-bottom: 20px; width: 300px; border: 1px solid #ddd; padding: 10px; box-sizing: border-box; } .product-list li img { width: 100%; } .product-list li h3 { font-size: 18px; margin: 10px 0; } .product-list li p { margin: 10px 0; } .price { font-size: 24px; color: #f90; margin-right: 10px; } .add-to-cart { padding: 5px 10px; border-radius: 5px; border: none; background-color: #f90; color: #fff; cursor: pointer; } .sidebar { flex-basis: 200px; margin-left: 20px; } .sidebar h2 { font-size: 20px; margin: 20px 0; } .sidebar ul { list-style: none; margin: 0; padding: 0; } .sidebar ul li { margin-bottom: 10px; } .sidebar ul li a { text-decoration: none; color: #333; } footer { background-color: #ddd; padding: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; } .footer-nav ul { list-style: none; margin: 0; padding: 0; } .footer-nav ul li { margin-right: 20px; } .footer-nav ul li a { text-decoration: none; color: #333; } .social-media { display: flex; flex-wrap: wrap; align-items: center; } .social-media a { margin-right: 10px; } .social-media img { width: 30px; height: 30px; } .copy-right { margin-top: 20px; } ``` JavaScript 代码: ``` // 可以在这里添加一些动态效果,如轮播图、下拉菜单等。 ``` 以上是一个简单的示例,您可以根据实际需要进行修改和完善。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值