2016-05-06 7 views
-1

Ich habe meinen HTML-Code und auch mein CSS hinzugefügt. Ich bin sehr verwirrt darüber, wie ich diese Webseite ansprechen würde. Wenn sich ein Benutzer auf einem anderen Gerät befindet, wird die Webseite automatisch auf ihr Gerät skaliert. (Sorry, wenn das eine wiederholte Frage ist, konnte ich die Antwort nicht finden).Responsive Webpage

 footer { 
      margin: 50px 0; 
     } 

     .fade { 
      opacity: 1; 
      transition: opacity .25s ease-in-out; 
      -moz-transition: opacity .25s ease-in-out; 
      -webkit-transition: opacity .25s ease-in-out; 
     } 

     .fade:hover { 
      opacity: 0.5; 
     } 

     h1 { 
      margin: .67em 0; 
      font-size: 2em; 
      font-family: 'Dosis', sans-serif; 
     } 

     body { 
      font-family: 'Dosis', sans-serif; 
      font-size: 14px; 
      line-height: 1.42857143; 
      color: #333; 
      background-color: #fff; 
      padding-right: 5px; 
     } 

     body { 
      max-width: 1000px; 
      margin: 10px auto; 
     } 

     body { 
      font-family: 'Dosis', sans-serif; 
     } 

     body { 
      background: white; 
     } 

     .container { 
      max-width: 100%; 
      text-align: center; 
     } 

     .centre { 
      position: relative; 
      display: inline-block; 
      float: left; 
      max-width: 100%; 
      padding: 50px; 
     } 

     ul { 
      max-width: 100%; 
      list-style-type: none; 
      margin: 0; 
      padding: 0; 
      overflow: hidden; 
      background-color: #333; 
     } 

     li { 
      float: left; 
      max-width: 100%; 
     } 

     li a { 
      display: block; 
      color: white; 
      text-align: center; 
      padding: 14px 16px; 
      text-decoration: none; 
     } 

     a:hover:not(.active) { 
      background-color: #111; 
     } 

     .active { 
      background-color: #4CAF50; 
     } 

     .accordion { 
      width: 895px; 
      height: 485px; 
      max-width: 100%; 
      overflow: hidden; 
      box-shadow: 0 10px 6px -6px #111; 
      margin: 20px auto 
     } 

     .accordion ul { 
      width: 200%; 
      max-width: 100%; 
     } 

     .accordion li { 
      position: relative; 
      display: block; 
      width: 160px; 
      max-width: 100%; 
      float: left; 
      box-shadow: 0 0 30px 8px #222; 
      transition: all 0.4s ease .300ms; 
     } 

     .accordion ul:hover li { 
      width: 40px 
     } 

     .accordion ul li:hover { 
      width: 640px 
     } 

     .caption { 
      background: rgba(0, 0, 0, 0.5); 
      position: absolute; 
      bottom: 0; 
      width: 640px 
     } 

     .caption a { 
      display: block; 
      color: #fff; 
      text-decoration: none; 
      font: normal 16px'Lato', Helvetica, Arial, sans-serif; 
      -webkit-font-smoothing: antialiased; 
      padding: 10px; 
     } 

     .center { 
      align-content: center; 
     } 

     .thumbnail { 
      display: block; 
      padding: 4px; 
      padding-left: 5px; 
      margin-bottom: 20px; 
      line-height: 1.42857143; 
      background-color: #fff; 
      border: 1px solid #ddd; 
      border-radius: 4px; 
      -webkit-transition: border .2s ease-in-out; 
      -o-transition: border .2s ease-in-out; 
      transition: border .2s ease-in-out; 
     } 

     .thumbnail > img, 
     .thumbnail a > img { 
      margin-right: auto; 
      margin-left: auto; 
     } 

     a.thumbnail:hover, 
     a.thumbnail:focus, 
     a.thumbnail.active { 
      border-color: #337ab7; 
     } 

     .thumbnail .caption { 
      padding: 9px; 
      color: #333; 
     } 
<body> 

    <nav class="contain"> 
    <div> 
     <div> 
     <ul> 
      <li><a class="active" href="index.html">Home</a> 
      </li> 
      <li><a href="Nike_Shoes1.html">Mens Shoes</a> 
      </li> 
      <li><a href="women_clothing.html">Womens Shoes</a> 
      </li> 
      <li><a href="boys_clothing.html">Boys Shoes</a> 
      </li> 
      <li><a href="boys_clothing.html">Girls Shoes</a> 
      </li> 
     </ul> 
     </div> 

    </div> 

    </nav> 


    <div class="container"> 

    <div> 


     <div> 

     <div class="accordion"> 
      <ul> 
      <li> 
       <div class="caption"><a href="#">Slide 1</a> 
       </div> 
       <a href="#"> 
       <img src='Slider_Image1.jpg' /> 
       </a> 
      </li> 

      <li> 
       <div class="caption"><a href="#">Slide 2</a> 
       </div> 
       <a href="#"> 
       <img src='Slider_Image2.jpg' /> 
       </a> 
      </li> 

      <li> 
       <div class="caption"><a href="#">Slide 3</a> 
       </div> 
       <a href="#"> 
       <img src='Slider_Image3.jpg' /> 
       </a> 
      </li> 

      </ul> 
     </div> 

     </div> 

     <div> 

     <div class="centre , fade ,"> 
      <div> 
      <a href="Nike_Shoes1.html"> 
       <img src="Image1.jpg" alt=""> 
      </div> 
     </div> 

     <div class="centre , fade"> 
      <div> 
      <a href="Nike_Trainers.html"> 
       <img src="Image2.jpg" alt=""> 

      </div> 
     </div> 

     <div class="centre , fade"> 
      <div> 
      <img src="Image3.jpg" alt=""> 
      </div> 
     </div> 


     <div class="centre , fade"> 
      <div> 
      <a href="boys_clothing.html"> 
       <img src="Boys_Clothing.jpg" alt="Boys Clothing"> 
      </div> 
     </div> 





     </div> 

    </div> 

    </div> 

    </div> 

    </div> 


    <div> 
    <!-- Footer --> 
    <footer> 



    </footer> 

    </div> 
+0

helfen http://www.w3schools.com/html/html_responsive.asp – GolezTrol

Antwort

1

Sie machen eine Seite als Reaktion von Medien-Anfragen an die CSS-Datei, zum Beispiel das Hinzufügen:

@media(max-width: 800px){ 
    /* Add mobile styles here */ 
} 

Sie können hier mehr über Medienanfragen sehen, da es viele configs sind verfügbar: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

+0

Ich weiß, über Medien-Anfragen, aber ich bin nicht auf sicher, wie sie –

+0

@Luke P zu verwenden, In Ihrer CSS-Datei haben Sie also beispielsweise Folgendes: https://jsfiddle.net/kgoq2pcg/ –