2016-08-18 51 views
0

我想要左侧边栏和边距线保持原位而有人向下滚动site。但侧边栏不断改变它的位置here与屏幕大小调整。任何修复?Css侧栏静态

@media only screen and (max-width: 550px) { 
    .side-bar-icon { 
     display: none; 
    } 
    .side-line { 
     position: relative; 
     max-width: 36rem; 
     border-right: none; !important; 
     border-bottom: thick solid #ef4a60; 
     padding-bottom: 30px; 
     margin-bottom: 50px; 
    } 

参考代码here

+0

这里有一个类似的问题:http://stackoverflow.com/questions/15590803/how-to-implement-fixed-sidebar-correctly –

+1

问题寻求帮助的代码必须包括必要的最短的代码重现它**在问题本身**最好在[** Stack Snippet **](https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets /)。虽然您提供了[**链接到示例或网站**](http://meta.stackoverflow.com/questions/254428/something-in-my-web-site-or-project-doesnt-work-如果链接变得无效,那么你的问题对于其他具有相同问题的未来SO用户将没有任何价值。 –

+0

@Paulie_D感谢您的建议。我已经添加了代码。 –

回答

1
@media (min-width: 550px) 
.eight.columns { 
    width: 65.3333333333%; 
    /* margin-left: 45%; comment this out*/ 
} 

.side-bar { 
    position: relative;/* change fixed to relative */ 
    top: 1; 
    left: 1; 
} 

只是一个补充上,使用!important是非常不好的做法之前,除非非常-非常重要的。只是一个建议!

enter image description here

+0

对“.side-line”的任何更改?这个https://github.com/abhigenie92/django-resumator/blob/temp_version/resumator/static/resumator/css/base.css#L15上面应该是@media吗? –

+0

请检查编辑问题 –

+0

@AbhishekBhatia .eight.columns位于名为“八列内容”的不同类中!现在,我以正确的格式看到你的身边!你呢? – Smit