2013-07-16 101 views
0

我在页面上有一个Call to Action按钮,我试图稍微向右移动,以便更好地与页面上方的文本/图像对齐。我尝试的任何事情都会将它移到其他元素的后面,或者什么也不做。任何提示/技巧/解决方案将是伟大的。 CSS列在下面。谢谢。正在移动CTA按钮

 .cta-button { 
    margin: 10px auto; 
    clear: both; 
    float: none !important; 
    padding-left:30px; 
    height: auto !important; 
} 
      .cta-on-phone-alignment { text-align: center !important; clear: both  !important; height: 70px; 0 0 0; vertical-align: baseline !important; } 
      img.hero { 
    clear: inherit !important; 
    margin: 0 auto !important; 
    text-align: center !important; 
    float: none !important; 
} 

该按钮位于的HTML。如果需要更多,请告诉我。我对网页设计还是比较陌生,所以这些仍然让我感到困惑。

<div class="row cta-on-phone-alignment"> 
          <!-- Button links to bottom of page --> 
          <a href="#bottom" class="cta-button" style="text-align:center !important;">Contact Us</a> <!-- Call To Action Button --> 
         </div> 
+1

请张贴您的HTML。一个jsFiddle.net的例子也会有帮助。 – j08691

+0

这将是影响它的所有“重要”声明。您将需要删除它们或添加内联CSS。一个例子或更多的代码,将有所帮助。 – Xareyo

+0

我编辑了一些HTML ...如果我需要发布更多,请让我知道什么是需要的。谢谢。 – Jeremiah

回答

0

要确保按钮位于堆栈的前面,您需要使用z-index AND定位。

尝试

.cta-button { 
    margin: 10px auto; 
    clear: both; 
    float: none !important; 
    padding-left:30px; 
    height: auto !important; 

    position: relative; 
    z-index: 1000; 
} 

这将有很大的帮助,如果你可以发布你的HTML过,但!

+0

我发布了控制cta按钮的div的代码。我需要包含的任何其他HTML或CSS部分? – Jeremiah