我目前正在使用Michael Hartl在rails rails上进行ruby教程,而我目前正在使用Bootstrap版本3.问题是我的按钮没有像中心那样对齐文字是Bootstrap按钮在与CSS对齐后未居中对齐
这是它应该看起来像
但是我的样子
是对齐文本和按钮来实现这些CSS样式后的变化教程:
有人可以指引我在正确的方向吗?我的超大屏幕的代码是这样的:
<div class="jumbotron">
<h1>Welcome to the Sample App</h1>
<h2>
This is the home page for the
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</h2>
<%= link_to "Sign up now!", '#', class: "btn btn-primary btn-lg" %>
</div>
<%= link_to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails.org/' %>
我得承认,我不是伟大的CSS,否则我早就想通了这一点,我自己 谢谢!
我该如何为我的jumbotron添加一个中心? –
@ApprenticeProgrammer,因为你想把它集中在你的jumbotron中。看看一些CSS提示和技巧:http://www.w3.org/Style/Examples/007/center.en.html – vee