1.html代码

<div >
<label class="checkbox-inline first-label">
<input type="radio" name="getOption" id="option1" value="option1" checked>张三
</label>
<label class="checkbox-inline">
<input type="radio" name="getOption" id="option2" value="option2"> 李四
</label>
<label class="checkbox-inline">
<input type="radio" name="getOption" id="option3" value="option3"> 王五
</label>
</div>

2.css代码

.checkbox-inline{
          padding:;
          margin:0 15px 0 0;
          line-height: 20px;
          min-height: 20px;
}
input[type='checkbox'], input[type='radio'] {
          margin: -2px 5px 0 0;
          line-height: 20px;
}

3.css内的只可根据需要相应调整,本文针对label行高20px举例。

针对bootstrap内联单选框input与文字不能居中对齐的解决办法的更多相关文章

  1. html 复选框(checkbox)和单选框(radio)与文字水平垂直居中对齐

    对 input与label同时设置CSS input,label{ vertical-align:middle; }

  2. npm install 报错 error Unexpected end of JSON input while parsing near '...sShrinkwrap":false,"d' 解决办法

    npm install 报错 : error Unexpected end of JSON input while parsing near '...sShrinkwrap":false,& ...

  3. Bootstrap内联表单

    有时候我们需要将表单的控件都在一行内显示,就需要将表单控件设置成内联块元素(display:inline-block). 在Bootstrap框架中实现这样的表单效果是轻而易举的,你只需要在<f ...

  4. 单选框input:radio

      单选框 CreateTime--2017年5月15日11:40:04 Author:Marydon 四.单选框 (一)语法 <input type="radio"/> ...

  5. form中 单选框 input[type="radio"] 分组

    在form中有时候需要给单选框分组,这种情况下 可以通过给单选框设置相同的name来进行分组: <html> <head> <title> </title&g ...

  6. bootstrap日期控件在火狐下的模态框中选择时间下拉菜单无效的解决办法

    今天收到程序组提交的一个兼容BUG,在火狐中使用模态框加载日期控件时选择时间下拉菜单没有效果(不能点击),而在谷歌中却是好的, 排错思路:1,在当前页面主层放置一个时间控件,测试通过 2,在ajax加 ...

  7. IE7下,input元素相对父级元素错位解决办法

    原因: 当input仅仅包含父元素,父元素拥有margin属性时,IE7的input就会错误的继承margin属性. 解决办法: 给input元素外面套一个span,label这样的内联元素,这样就会 ...

  8. bootstrap: 内联表单;

    <form class="form-inline"> <div class="form-group"> <label for=&q ...

  9. 修改HTML5 input placeholder 颜色及修改失效的解决办法

    input::input-placeholder{color: #bdbdbd ;} /* 有些资料显示需要写,有些显示不需要,但是在编辑器webstorm中该属性不被识别 */ ::-webkit- ...

随机推荐

  1. 承接Hololens游戏外包

    近日,微软宣布第三批微软Hololens开发者版开始发货,包括:头显.头显手提包和一个遥控器.前两批开发者版本分别在今年3月30日和5月9日开始发货的. 第三批AR头显Hololens开发者版发货 虽 ...

  2. <<Exceptional C++>> notes

    - class Complex { public: ) : real_(real), imaginary_(imaginary) { } Complex& operaor+=(const Co ...

  3. 黄聪:解决Web部署 svg/woff/woff2字体 404错误

    问题:最近在IIS上部署web项目的时候,发现浏览器总是报找不到woff.woff2字体的错误.导致浏览器加载字体报404错误,白白消耗了100-200毫秒的加载时间. 原因:因为服务器IIS不认SV ...

  4. Spring Integration

    @ContextConfiguration directs Spring's test runner to locate a configuration file with the same name ...

  5. TCP 常用总结

    SO_RCVBUF SO_SNDBUF TCP socket在内核中都有一个发送缓冲区和一个接收缓冲区,不管进程是否读取socket,对端发来的数据都会经由内核接收并且缓存到socket的内核接收缓冲 ...

  6. 利用swap技巧去除容器多余的容量

    假设我们预先为容器添加了一部分元素,接着用clear将它们删除,容器内部分配的存储空间实际上不会减小,改变的只是能够访问的元素个数.如下所示: std::vector<int> vec; ...

  7. Cacti监控Centos抓包unreachable - admin prohibited

    :: 抓包发现总是有这个出现,而且是跟在GetRequest后面. 打开iptables配置: 最开始网上找的配置语句是这个, -A INPUT -p udp -m udp --sport -j AC ...

  8. View & draw

    When an iOS application is launched, it starts a run loop. The run loop’s job is to listen for event ...

  9. SQL Server获取月度列表

    -- 获取月度列表 if exists(select 1 from sysobjects where name = 'proc_GetDateMonthList' and type = 'p') dr ...

  10. 根据不同分辨率加载不同 css 样芪表

    <script language=javascript> <!-- if (screen.width == 800) { document.write('<link rel=s ...