Bootstrap3基础 form-horizontal 表单元素横向布局 简单示例
2024-10-15 07:52:20
内容 | 参数 |
---|---|
OS | Windows 10 x64 |
browser | Firefox 65.0.2 |
framework | Bootstrap 3.3.7 |
editor | Visual Studio Code 1.32.1 |
typesetting | Markdown |
code
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<!-- IE将使用最新的引擎渲染网页 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- 页面的宽度与设备屏幕的宽度一致
初始缩放比例 1:1 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo</title>
<meta name="author" content="www.cnblogs.com/kemingli">
<!-- 引入外部bootstrap的css文件(压缩版),版本是3.3.7 -->
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 -->
<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
<!--[if lt IE 9]>
<script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- start : demo -->
<div class="container" style="background-color:gray">
<form class="form-horizontal">
<div class="form-group">
<!-- 属性值col-xs-3中,这个数字3是根据实践经验而来的 -->
<label class="col-md-2 col-sm-2 col-xs-3 text-right" for="username">
用户名
</label>
<!--
为什么要用div把input包裹起来呢?
因为输入框不能使用栅格系统,也就是说 input不能加 col-xx-xx。
-->
<div class="col-md-10 col-sm-8 col-xs-6">
<input type="text" name="username" id="username" class="form-control" />
</div>
</div>
</form>
</div>
<!-- 输入框大小会随着浏览器大小的变化而变化,自己也可以试一试,挺好玩的。 -->
<!-- end : demo -->
<!-- NO.1 加载框架依赖的jQuery文件(压缩版),版本是1.12.4 -->
<script src="bootstrap/js/jquery.min.js"></script>
<!-- NO.2 加载Bootstrap的所有JS插件,版本是3.3.7 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>
result
resource
- [ 文档 ] getbootstrap.com/docs/3.3
- [ 源码 ] github.com/twbs/bootstrap
- [ 源码 ] archive.mozilla.org/pub/firefox/releases/65.0/source/
- [ 平台 ] www.cnblogs.com
- [ 平台 ] github.com
- [ 扩展 - 平台] www.bootcss.com
- [ 扩展 - 浏览器 ] www.mozilla.org/zh-CN/firefox/developer
Bootstrap是前端开源框架,优秀,值得学习。
博文讲述的是V3版本,更为先进的是V4版本。学有余力的话,可作简单地了解。
Firefox是开源的浏览器,优秀,值得关注。
面对开源框架,分析、领悟与应用,能对其进行加减裁化,随心所欲而不逾矩。
博文的质量普通,仅供参考。盲目复制,处处是坑。Think twice before you act(三思而后行)!
最新文章
- a版本冲刺第七天
- scp命令详解
- java代码
- file:///Users/xmg/Desktop/xiangmu~Bsbdejie/BaisibudejieTheSecondtime/BaisibudejieTheSecond/BaisibudejieTheSecond/AppDelegate.m: warning: Missing file: /Users/xmg/Desktop/xiangmu~Bsbdejie/BaisibudejieT
- golang github.com/go-sql-driver/mysql 遇到的数据库,设置库设计不合理的解决方法
- Static Constructors
- No.012:Integer to Roman
- mac 安装PIL
- Bzoj 1703: [Usaco2007 Mar]Ranking the Cows 奶牛排名 传递闭包,bitset
- PAT 团体程序设计天梯赛-练习集 L1-008. 求整数段和
- 第13章 Swing程序组件----常用布局管理器
- ORACLE获取字符串中数字部分
- SQL Server 扩展事件(Extented Events)从入门到进阶(4)——扩展事件引擎——基本概念
- java31
- ASP.NET Core 应用发布与部署指南
- fibonacci数列的性质和实现方法
- Day19作业及默写
- 再谈vim中多窗口的编辑 ctrl+w+H窗口位置最大化和互换等操作
- FaceBook: Text Tag Recommendation
- [BZOJ1860][ZJOI2006]Mahjong(DP)