2017-08-15 57 views
1

问题:我有一个页脚,我已经设置为在桌面视图上工作。当页脚进入移动视图时,它就像我想要的那样工作,期望文本。如何确定移动css优先于桌面css

该文本使用在桌面视图而不是移动视图上设置的css。所以当我想把所有的文字对齐到中心时,我都不能。它使用桌面css,这意味着文本的第一行将向左浮动,左边:40px;等等。

我已经尝试了与移动的CSS混乱,并没有找到答案。我觉得我错过了一些重要的东西。有人可以解释我做错了什么,并向我展示解决方案。会非常appriciate!

https://jsfiddle.net/7vmb5gz8/

<div class="footer"> 
     <div class="footer_info"> 
      <div class="footer_contact"><b>TEL:</b> 6 979 200; <b>E-Post:</b> <a class="footer_email" href="mailto:[email protected]" target="_top">[email protected]</a></div> 
      <div class="footer_links"><a href="#" class="footer_frens_link">Frens Catering</a>; <a href="#" class="footer_shop_link">E-Pood</a></div> 
      <div class="footer_rights">© Kõik õigused kaitstud. Frens 2017</div> 
     </div> 
</div> 

回答

3

您有无效的语法在CSS

.footer_contact !important{ 
    float:none; 
    text-align: center; 
} 

删除!important或将其更改为:

.footer_contact{ 
    float:none !important; 
    text-align: center; 
} 

JsFiddle

+0

哦!说得通。所以你不能在整个班级中使用!有趣!这样可行。谢谢! :) – CrimzonWeb

+0

我认为你甚至可以在这种情况下完全删除重要的东西!? – VA79