html - 底部的按钮被切成薄片

标签 html css button sass

为什么在底部我的按钮是切片的?我需要它在每个 Angular 落都是圆形的...... 现在我有这个: enter image description here 但是,如果我写信给橙色按钮类 css 属性 float: left,我得到结果,我需要什么……但这是个坏主意。 enter image description here 正常情况下怎么办?

(我也用sass+haml)

.orange-button{
  padding: 6px;
  @include gradient-background(bottom, $or1, #fbb752); 
  //background: url('button-carbon-bg.png') no-repeat, -webkit-linear-gradient(bottom, $or1, #fbb752);
  @include border-radius(5px, 5px, 5px, 5px);
  //background: transparent url('button-carbon-bg.png') no-repeat;
  border: 1px solid #d27d00;
  font-family: “Myriad Pro”, Arial, Helvetica, Tahoma, sans-serif;
  font-weight: bold;
  font-size: 16px;
  color: $or3;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .70);
  font-style: normal;
  @include box-shadow(inset 0 1px 0 rgba(255,255,255,0.5));
  border-bottom:2px solid #B16900;
}
.orange-button:hover{
  @include gradient-background(bottom, #eba641, #fcc97d); 
}

和 fiddle : http://jsfiddle.net/Zfq73/

最佳答案

如果您不想使用包装器或溢出,另一种解决方案是将 display: inline-block 添加到 .orange-button

查看更新的 fiddle :http://jsfiddle.net/Zfq73/2/

附言我总是喜欢在我的样式表中添加单独的 css 元素显示类,称为 .inline-block.block

 .inline-block {
 display: inline-block;
 }

.block {
display: block;
}

HTML:

<button class="orange-button inline-block">only THIS orange button is an inline button!</button>

这样你就可以将 display: inline-blockdisplay: block 附加到单独的按钮上,而不必让所有的橙色按钮都 display: inline-block

关于html - 底部的按钮被切成薄片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13953324/

相关文章:

css - parent 高度不跟随他们的 float child

html - 更改 html 骨架的默认设置或格式?

c# - 如何将按钮添加到 TabPage 的页眉?

android - 无法捕获android后退按钮事件

WPF 按钮 - 按下时的方法

html - float block 崩溃

jquery 滚动顶部不工作

HTML 表单字段在 chrome 中不可用,在 IE 中有效

java - Spring Boot 没有静态资源映射

javascript - 基于 routerLinkActive 的 Angular 高亮