2012-11-20 6 views
1

반응 형 디자인을 작업하면서 정렬되지 않은 목록을 제외하고 모든 것이 반응적임을 확인했습니다. 브라우저의 크기를 조정하면 목록이 이동하거나 DIV의 가운데에 머물러 있지 않습니다. 나는 하루 종일 여러 가지 시도를 해봤지만 단순히 알아 내지 못합니다. 컨텍스트의 경우 #sitecontent는 모든 것을 담는 컨테이너이며 #sitecontent .leftsidebar에는 이미지와 순서가없는 목록이 있으며 #sitecontent .leftsidebar ul은 순서가 지정되지 않은 목록입니다. 누군가 그것을 확인하고 무엇이 잘못되었는지 말해 줄 수 있습니까?반응 형 CSS의 경우 DIV에서 정렬되지 않은 목록이 필요합니까?

@-moz-document url-prefix() { 
* { font-weight: 400; } 
h1, h2 
} 

@font-face { font-family: 'helvetica neue'; src: local('Arial'); } 

x:-o-prefocus, h1 { 
padding-top: 22px; 
} 

x:-o-prefocus, h2 { 
margin-top: -2%; 
} 

x:-o-prefocus, ul li { 
line-height: 20px; 
} 


#sitecontent { 
display: block; 
width: 90%; /* 780px */ 
max-width: 780px; 
padding-top: 150px; 
margin: 0 auto; 
} 

#sitecontent .leftsidebar { 
float: left; 
width: 19.2%; /* 150px */ 
} 

#profilepic { 
-moz-border-radius: 20px; 
border-radius: 20px; 
max-width: 100%; 
} 
#sitecontent .leftsidebar ul { 
position: relative; 
top:-5px; 
list-style-type: none; 
font-family: 'Patua One', cursive; 

} 

#sitecontent a { 
text-decoration: none; 
color: #3f83ca; 
} 

#sitecontent .leftsidebar ul li{ 
display:inline; 
margin-bottom: 3%; 
float: left; 
clear: both; 
border-bottom: 1px solid #E5E5E5; 
font-family: helvetica; 
} 

#sitecontent .leftsidebar ul li:hover { 
border-bottom: 1px solid #3f83ca; 
} 



#sitecontent .rightsidebar { 
float: right; 
width: 76.9%; 

} 

#sitecontent .rightsidebar > h1 { 
font-size:3.750em; 
font-weight: normal; 
color: #3f83ca; 
line-height: 0; 
font-family: helvetica; 
font-weight:bold; 

} 

#sitecontent .rightsidebar > h2 { 
line-height: 10px; 
font-weight: normal; 
color: #38414f; 
font-family: helvetica; 
font-weight: bold; 

} 

#sitecontent .rightsidebar > p { 
text-align: justify; 
padding-top: 16px; 
line-height: 20px; 
font-size: 0.938em; 
font-family:'Helvetica Neue', Arial, sans-serif; 


} 

#secondparagraph { 
text-align: justify; 
color: #A1A1A1; 
font-family:'Helvetica Neue', Arial, sans-serif; 


} 

#secondparagraph:hover { 
color:#3f83ca; 
opacity: 1.0; 

} 

#secondparagraph a { 
font-size: 14px; 
text-decoration: none; 
color: inherit; 
} 

@media screen and (max-width: 480px) { 


#sitecontent { 
width: 100%; 
padding-top: 10px; 
} 

#sitecontent .leftsidebar { 
width: 100%; 
float: none; 
} 

#profilepic { 
display:block; 
margin: 0 auto; 
border-radius: 77px; 
float:none; 
} 

#sitecontent .leftsidebar ul { 
position: relative; 
top:35px; 
} 



#sitecontent .leftsidebar ul li{ 
margin-bottom: none; 
border-bottom: none; 
float: none; 
clear: none; 
padding:10px; 
border-radius: 2px; 
background-color:#3f83ca; 
border: 1px solid #00688B; 
font-family: helvetica; 
font-weight: 400; 
} 

#sitecontent a { 
text-decoration: none; 
color: #EDEDED; 
} 

#sitecontent .leftsidebar ul li:hover { 
border-bottom: none; 
} 

#sitecontent .rightsidebar { 
float: none; 
margin: 0 auto; 
width: 90%; 

} 

#sitecontent .rightsidebar > h1 { 
position: relative; 
bottom: 36px; 
text-align: center; 
font-size:1.875em; 
font-weight: 600; 
color: #3f83ca; 
margin-top: 6%; 
font-family: helvetica; 
font-weight:bold; 

} 

#sitecontent .rightsidebar > h2 { 
display:none; 

} 

#secondparagraph { 
display: none; 

} 

#sitecontent .rightsidebar > p > a:first-child { 
color:#3f83ca; 
} 

} 
+0

HTML 코드로 사이트 링크를 제공하거나 jsfiddle를 게시 한 경우 도움이 될 수 있습니다. –

+0

내 사이트의 출처를 확인하십시오. http://www.tommaxwell.me –

+0

반응 형 디자인 작업은 좋은 생각입니다.하지만 앞으로 나아갈 때는 발가락에 담그면 안됩니다. 다이빙을해야합니다. 거의 모든 수치를 정의하기 위해'em's '와 퍼센트를 사용하고, 아직 미디어 쿼리를 추가하지 않은 경우에 추가로 살펴 봅니다. – Dom

답변

0

사이트가 최소화되어 있고 가장 작을 때 중심 맞춤 문제 만 보았습니다.

나는 text-align:center;을 추가했습니다.

#sitecontent .leftsidebar { 
    width: 100%; 
    float: none; 
    text-align: center; 
} 
+0

화면 크기를 이동하면서 위치를 유지하는 데는 효과가있는 것처럼 보이지만 사실 중심 목록이 아니기 때문에 문제가됩니다. –

+0

나는 오른쪽 : 20px; 이를 해결하기 위해서는 화면 회전과 같은 작업을 수행 할 때 움직이지 않기 때문에 응답 성이 뛰어난 디자인의 목적에 어긋납니다. –

+0

내가 말하고자하는 것은 모바일 사이트 (브라우저가 가장 작을 때)의 목록을 중심에 두지 않는다는 것입니다. –

관련 문제