愚蠢的问题,但我似乎无法解决这个问题。
我想要的按钮说明:获取更多客户端(位于右侧的计算机下方),在计算机下方居中。我不确定我做错了什么。感谢。
以下是网址:http://www.sanfranciscocriminaldefenseattorney.net/
这是HTML:
<div class="c2">
<div class="sidebar sidebar-primary theme-info-sidebar">
<div class="text_box">
<div class="gsb">
<div class="get_started">
<a class="button3" target="_blank" href="https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http://themedy.com/themes/grind/&p[title]=Grind - A child theme for Thesis and Genesis&p[images][0]=http://themedy.com/wp-content/uploads/2012/09/grind-demo-header.jpg&p[summary]=">Get More Clients</a>
</div>
</div>
</div>
</div>
这里是CSS:
columns > .c2 {
box-sizing: border-box;
}
.sidebar {
display: inline;
line-height: 1.5;
}
.gsb {
margin: 0 auto;
width: 100%;
}
.get_started {
margin: 0 auto;
width: 100%;
}
.get_started .button3:before {
display: inline-block;
padding-right: 7px;
vertical-align: middle;
}
.get_started .button3 {
background: none repeat scroll 0 0 #2d609b;
font-size: 18px;
text-align: center;
text-transform: none;
width: 80%;
}
.button3 {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #cd3333;
border-color: rgba(0, 0, 0, 0.15);
border-image: none;
border-style: solid;
border-width: 0 0 4px;
color: #fff;
cursor: pointer;
display: inline-block;
font-size: 1.25rem;
font-weight: bold;
line-height: 28px;
padding: 1rem 2.25rem 0.8125rem;
text-decoration: none;
text-transform: uppercase;
width: auto;
}
答案 0 :(得分:3)
似乎您希望按钮中心在较低的屏幕宽度处对齐,因为在桌面上它看起来很好;它只会在较低的断点处出现偏斜。最好的方法是:
.get_started {
text-align: center;
}
答案 1 :(得分:3)
按钮.get_started .button3
下面应该做的工作:
.get_started {
margin: 0 auto;
width: 100%;
text-align:center;
}
... some more styles ...
.get_started .button3 {
background: none repeat scroll 0 0 #2d609b;
font-size: 18px;
text-align: center;
text-transform: none;
/*width: 80%;*/
width:auto;
}
答案 2 :(得分:1)
答案 3 :(得分:0)
.get_started{width: 100%;
margin: 0px auto;
text-align: center;}
.get_started .button3{background: none repeat scroll 0px 0px #2D609B;
font-size: 18px;
text-align: center;
text-transform: none;
width: 40%;
margin: 0px auto;}
此代码允许您使用您想要的任何宽度,当我检查您有40%时,您可以根据需要进行更改