2016-08-18 52 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