所以......这开始让我恼火......我想我会来这里得到一些帮助..
盒子周围的主要div有一个宽度...然后有文本......和我想要的按钮在div的中心..
它是一个<a href>按钮..但它不会居中.
我不认为我需要指定宽度,因为外部div有宽度..我试过margin:0 auto; text-align:center等没有任何作用
<h2 class="service-style color_service">Annoyed</h2>
<div class="service-text text1">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Lorem ipsum dolor sit amet…
</p>
<a href="" class="button button-large"><i class="fa fa-credit-card" style="padding-right:10px;"></i> Learn More</a>
</div>
Run Code Online (Sandbox Code Playgroud)
这是小提琴的链接
我有 a<div>和 a <button>,但由于某种原因,按钮不会留在 div 中。
我试图清除 div,float: left但它没有帮助。
我也添加padding到 div 的底部,但我认为这不是解决方案。
我的代码:
<div class="service-text text2">
<p>
this is some text
</p>
<a href="" class="button-learn centered"><i class="fa fa-credit-card" style="padding-right:10px;"></i> Learn More</a>
</div>
Run Code Online (Sandbox Code Playgroud)
我有一个100%宽度的DIV .....在网格系统内..总网格是1140px ..
无论如何在div里面是100%我插入了一张图片......
问题是如果div背景是黑色...底部有1厘米仍然显示黑色.
像这样
<div style="background:black; width:100%;">
<img src="http://i42.tinypic.com/ofq9tg.png" >
Run Code Online (Sandbox Code Playgroud)
我应该在图像上使用浮动吗?或使用显示器:块?