• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com专业计算机教程网站
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure
您的位置:首页 > 网页设计 >html/xhtml > 网页设计之5种简单的XHTML网页表单

网页设计之5种简单的XHTML网页表单

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-08-05

本文主要包含网页,简单,网页设计,<,",input,/>,type,name等相关知识,佚名 希望在学习及工作中可以帮助到您

网页设计之5中简单的XHTML网页表单。 技术1:标签三明治
将输入框,选择框和文本框全部包含进 label 元素,并全部设置为块级元素。将单选按钮和多选框显示方式设置为 inline 以便于它们在同一行出现。如果你比较喜欢 label 和单选按钮/多选框出现在不同行,可以选择不把它包含在 label 里面,或者使用硬换行处理。
每种情况都在下面展示了。

当这些看起来比较时髦的时候,W3C 事实上已经含蓄地展示了他们的 label 例子。
主要好处:简单
代码:
label, input, select, textarea {display: block;} label {margin-bottom: 10px;} input[type="radio"], input[type="checkbox"] {display: inline;} <form> <fieldset> <legend>Contact Form</legend> <label for="name"> Name</label> <input id="name" name="name" size="20" /> <label for="email">Email</label> <input id="email" name="email" size="20" /> <label for=" Choices"> Choices (radio) — <em>wrapped label</em></label> <input name=" Choice" type="radio" /> Choice 1 <input name=" Choice" type="radio" /> Choice 2 <input name=" Choice" type="radio" /> Choice 3 <label style="margin-bottom: 0pt;" for=" Choices2"> Choices (checkbox) — <em>non-wrapped label, margin reset</em></label> <input name=" Choice2" type="checkbox" /> Choice 1 <input name=" Choice2" type="checkbox" /> Choice 2 <input name=" Choice2" type="checkbox" /> Choice 3 <div style="height: 10px;"><!-- just to split the demo up --></div> <label for=" Choices3"> Choices (checkbox) — <em>wrapped, hard line-break</em></label> <input name=" Choice3" type="checkbox" /> Choice 1 <input name=" Choice3" type="checkbox" /> Choice 2 <input name=" Choice3" type="checkbox" /> Choice 3 <label for="dropdown"> Question</label> <select id="dropdown"> <optgroup label="Group of Options"></optgroup> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select> <label for="message"> Message <textarea cols="36" rows="12" name="message"></textarea> </label> <input type="submit" value="send it" /> </fieldset> </form>
运行结果:
#expamle1 label,#expamle1 input,#expamle1 select,#expamle1 textarea {display: block;}
#expamle1 label {margin-bottom: 10px;}
#expamle1 input[type="radio"],#expamle1 input[type="checkbox"] {display: inline;}
技术2:懒人
许多开发者采用了这种不正统但是快速简单(用换行隔断标记)的方法。虽然能运行,但是对你的 css 能力有害,因为你不需要任何 css 去实现它。
主要好处:快速
代码:
<form> <fieldset> <legend>Contact Form</legend> <label for="name">Name</label> <input id="name" name="name" size="20" /> <label for="email">Email</label> <input id="email" name="email" size="20" /> <label for=" Choices"> Choices (radio)</label> <input name=" Choice" type="radio" /> Choice 1 <input name=" Choice" type="radio" /> Choice 2 <input name=" Choice" type="radio" /> Choice 3 <label for=" Choices3"> Choices (checkbox)</label> <input name=" Choice3" type="checkbox" /> Choice 1 <input name=" Choice3" type="checkbox" /> Choice 2 <input name=" Choice3" type="checkbox" /> Choice 3 <label for="dropdown">Question</label> <select id="dropdown"> <optgroup label="Group of Options"></optgroup> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select> <label for="message">Message</label> <textarea cols="36" rows="12" name="message"></textarea> <input type="submit" value="send it" /> </fieldset> </form>
运行结果:

您可能想查找下面的文章:

  • 浅谈Html网页表格结构化标记的应用
  • HTML基础必看---表单,图片热点,网页划区和拼接详解
  • 移动端网页大小自适应的实现方法
  • 在网页上调用桌面exe程序的简单方法
  • Adobe Brackets 简单使用图文教程
  • 网站不允许直接复制页面内容或信息的解除方法
  • html网页中meta viewport属性说明
  • 网页嵌入百度地图和使用百度地图api自定义地图的详细步骤
  • html文档基本结构(制作网页基础知识)
  • html网页插入图片、加入地图索引示例讲解

相关文章

  • 2017-08-05HTML 提高页面加载速度的方法
  • 2017-08-05HTML link标记的rel属性
  • 2017-08-05margin-top负值解决label 文字与input 垂直居中对齐问题
  • 2017-08-05关于IE8兼容:X-UA-Compatible属性的解释
  • 2017-08-05网页制作中注意应用HTML标签的问题
  • 2017-08-05使用iframe在网页中嵌入其他网页的方法
  • 2017-08-05图片元素img在IE6下出现多余空白问题
  • 2017-08-05网页设计之5种简单的XHTML网页表单
  • 2017-08-05无法定义IE6字体:13px大小无效,IE6自动显示更大的字体的解决方法
  • 2017-08-05W3C教程(12):W3C Soap 活动

文章分类

  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure

最近更新的内容

    • html中select optgroup标签使用介绍
    • 网页制作中使用规范的HTML代码的几点
    • HTML文档类型详解 推荐
    • HTML的表单form以及form内部标签的使用
    • 关于shortcut icon和icon代码的区别介绍
    • W3C教程(7):W3C XSL 活动
    • 通过href简单实现点击a链接跳到页面中指定的地方
    • 如何使用图片按钮作为重置(reset)表单按钮
    • table合并单元格与img图片铺满整个td的html
    • 用图片作为label,for属性IE下不起作用

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有