2014-11-19 3 views
-2

안녕하십니까, 내비게이션을 화면 크기가 320 또는 그 이하일 때 가운데에 놓으려고합니다. 정말로 로고를 중심에 놓고 네비게이션을 아래 중심에 배치하고 나머지는 그 다음에 배치합니다. 내가 뭘 잘못하고 있는지 알 수 없다. 여기 내 HTML반응 형 웹이 작동하지 않습니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <!-- <!DOCTYPE html> --> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <title>Jake Jones New Media Design</title> 

     <meta charset="utf-8"> 

    <link rel="stylesheet" type="text/css" href="style.css"/> 

<meta name="viewport" content="width=device-width, initial-scale=1"> 

</head> 
<body> 

<div class="wrapper"> 

    <div id="logo"><a href="index.html"><img src="logo.jpg" alt="logo"/></a></div> 

<ul id="Menu"> 
    <li> 
    <a href="index.html">Portfolio</a> 
    <ul> 
     <li><a href="index.html#web">Web</a></li> 
     <li><a href="index.html#campaign">Campaign</a></li> 
     <li><a href="index.html#print">Print</a></li> 
     <li><a href="index.html#motion">Motion</a></li> 
     <li><a href="index.html#photography">Photography</a></li> 
     <li><a href="index.html#vector">Vector</a></li> 
    </ul> 
    </li> 
    <li><a href="about.html">About</a></li> 
</ul> 
    <div class="text"> 

     <div class="imgContainer"> 
     <img src="img/me.jpg" style="width: 100%"/> 
    </div> 

     <p> 
Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend  tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, </p> 

<div class="pdf"> 
<a href="resume.pdf">Resume</a> | 
<a href="portfolio.pdf">Portfolio PDF</a> 
</div> 

<div class="contact"> 
(330)285-3158 <br/> 
<a href="mailto:[email protected]">[email protected]</a> 
</div> 

    </div> 


</div> 
</body> 
</html> 

입니다 그리고 이것은 내 CSS

@charset "UTF-8"; 

body { 
font-family: helvetica; 
font-size:12px; 
} 

.wrapper { 
margin: 0 auto; 
max-width: 980px; 
width: auto;   
} 

#logo { 
float: left; 
} 

#Menu, 
#Menu ul { 
list-style: none; 
} 

#Menu { 
float: right; 
margin-top: 85px; 
} 

#Menu > li { 
float: left; 
} 
#Menu li a { 
display: block; 
height: 2em; 
line-height: 2em; 
padding: 0 1.5em; 
text-decoration: none; 
} 

#Menu ul { 
position: absolute; 
display: none; 
z-index: 999; 
} 

#Menu ul li a { 
width: 50px; 
} 

#Menu li:hover ul { 
display: block; 
} 

/* Main menu 
------------------------------------------*/ 
#Menu { 
font-family: Arial; 
font-size: 12px; 
background: #ffffff; 
} 

#Menu > li > a { 
color: #000000; 
font-weight: bold; 
font-size: 15px; 
} 

#Menu > li:hover > a { 
background: #ffffff; 
color: #7a0808; 
} 

/* Submenu 
------------------------------------------*/ 
#Menu ul { 
background: #ffffff; 
padding: 0; 
list-style-type: none; 
width: 100px; 
} 

#Menu ul li a { 
color: #000000; 
font-size: 13px; 

}

#Menu ul li:hover a { 
color: #7a0808; 
} 

/* Content 
------------------------------------------*/ 
.text { 
clear: both; 

}

p { 
padding-top: 70px; 
padding-left: 40px; 
width: 275px; 
} 


.imgContainer { 
margin-top: 70px; 
float:right; 
clear: both; 
padding-right: 15px; 
} 

.pdf { 
padding-left: 40px; 
} 

.pdf a:link { 
color: black; 

}

012입니다
.pdf a:hover { 
color: #7a0808; 
} 

.pdf a:visited { 
color: #838383; 
} 

.contact { 
line-height: 17px; 
padding-top: 20px; 
padding-left: 40px; 
} 

.contact a:link { 
text-decoration: none; 
color: black; 
} 

img { 
    max-width:100%} 

} 


/*Responsive Styles*/ 

@media screen and (max-width : 300px){ 
#logo { 
    width: 50% 
    } 

    #Menu a:link { 
    padding: 0px; 
    text-align: center; 
    float: left; 
    width: 100%; 
    } 
} 

답변

-1

제 생각에는 300px 미디어 화면에도 클래스 래퍼 및 id 로고에 CSS를 써야한다고 생각합니다. 이것을 시도해 보면 반응이 좋을 것입니다.

1

이 닫는 괄호가

@media screen and (max-width: 360px) { 
#logo { 
    text-align:center; 
    float:none; 
    } 
#Menu{ 
    float:none; 
} 
#Menu > li { 
margin-right: 15px; 
} 
    #Menu a:link { 
    padding: 0px; 
    text-align: center; 
    float: left; 
    width: 100%; 
    } 
} 

체크 아웃 http://jsfiddle.net/nikkirs/vmcrtej3/

에 코드를 다음 반응 추가이

img { 
    max-width:100%; 
} 

과 같아야 마지막 하나를 제거 한 스타일의 img 태그를 확인하시기 바랍니다

관련 문제