2017-02-15 2 views
0

過去の割り当てに関するフィードバックを受け取って、画像がぼやけていることを警告しました。しかし、私はそれを修正する方法を把握することはできません。この課題は、何をすべきかについての非常に明確な説明を与えていますが、私はそれが求めたすべてを行いました。CSSでレンダリングすると画像がぼやけてしまうのを修正するには?

私はイメージのため、以下を実行する必要があります。

はyurtheroという名前の新しいセレクタIDを追加します。 300pxの高さを設定し、スペースを埋めるためにcoast.jpgの背景イメージを表示する(背景サイズ:100%100%;を使用する)CSSコードの宣言では、繰り返しません。

画像がぼやけるのを防ぐにはどうすればよいですか?それはストレッチがぼやけてしまうように思えます。

以下は、html5、css3、および私が使用している画像です。 coast.jpg

/* pacific.css for assignment #3 by Caleb Latimer */ 
 
body{ 
 
     background-color: #FFFFFF; 
 
     color : #666666; 
 
     font-family: Verdana; 
 
     background-image: url(background.jpg); 
 
} 
 
h1{ 
 
     background-color: #000033; 
 
     color : #FFFFFF; 
 
     font-family: Georgia; 
 
     line-height: 200%; 
 
     background-image: url(sunset.jpg); 
 
     background-repeat: no-repeat; 
 
     padding-left: 20px; 
 
     height: 72px; 
 
     margin-bottom: 0; 
 
     background-position: right; 
 
} 
 
nav{ 
 
     font-weight: bold; 
 
     background-color: #90C7E3; 
 
     padding: 5px 5px 5px 5px; 
 
} 
 
h2{ 
 
     color: #3399CC; 
 
     font-family: Georgia; 
 
} 
 
dt{ 
 
     color: #000033; 
 
     font-weight: bold; 
 
} 
 
.resort{ 
 
     color: #000033; 
 
     font-size: 1.2em; 
 
} 
 
footer{ 
 
     font-size: .70em; 
 
     font-style: italic; 
 
     text-align: center; 
 
     padding: 10px 10px 10px 10px; 
 
} 
 
#wrapper{ 
 
     width: 80%; 
 
     margin-right: auto; 
 
     margin-left: auto; 
 
     background-color: #ffffff; 
 
     min-width: 700px; 
 
     max-width: 1024px; 
 
     box-shadow: 5px 5px 5px #828282; 
 
} 
 
h3{ 
 
     color: #000033; 
 
} 
 
main{ 
 
     padding-left: 20px; 
 
     padding-right: 20px; 
 
     display:block; 
 
} 
 
#homehero{ 
 
     background-size: 100% 100%; 
 
     height: 300px; 
 
     background-image: url(coast.jpg); 
 
     background-repeat: no-repeat; 
 
} 
 
#yurthero{ 
 
     height: 300px; 
 
     background-image: url(yurt.jpg); 
 
     background-size: 100% 100%; 
 
     background-repeat: no-repeat; 
 
} 
 
#trailhero{ 
 
     height: 300px; 
 
     background-image: url(trail.jpg); 
 
     background-size: 100% 100%; 
 
     background-repeat: no-repeat; 
 
} 
 
nav a{ 
 
     text-decoration: none; 
 
}
<!-- Chapter 4 Homework by Caleb Latimer --> 
 
<!DOCTYPE html> 
 
<html lang="en"> 
 

 
    <head> 
 
    <meta charset="utf-8"> 
 
    <title>Pacific Trails Resort</title> 
 
    <link rel="stylesheet" href="pacific.css" /> <!-- Uses the pacific.css stylesheet inside of folder --> 
 
    </head> 
 
    <body> 
 
     <div id="wrapper"> 
 
      <header> 
 
        <h1>Pacific Trails Resort</h1> 
 
      </header> 
 

 
      <nav> 
 
      <a href="index.html">Home</a> 
 
      &nbsp; 
 
      <a href="yurts.html">Yurts</a> 
 
      &nbsp; 
 
      <a href="activities.html">Activities</a> 
 
      &nbsp; 
 
      <a href="reservations.html">Reservations</a> <!-- Doesn't lead anywhere no requirements given --> 
 
      </nav> 
 

 
      <div id ="homehero"></div> 
 
      <main> 
 
      <h2>Enjoy Nature in Luxury</h2> 
 

 
      <p> 
 
       <span class="resort">Pacific Trails Resort</span> offers a special lodging experience on the California North Coast. Relax in serenity with panoramic views of the Pacific Ocean. 
 
      </p> 
 

 
      <ul> 
 
       <li>Private yurts with decks overlooking the ocean</li> 
 
       <li>Activities lodge with fireplace and gift shop</li> 
 
       <li>Nightly fine dining at the Overlook Cafe</li> 
 
       <li>Heated outdoor pool and whirlpool</li> 
 
       <li>Guided hiking tours of the redwoods</li> 
 
      </ul> 
 

 
      <div> 
 
       <span class="resort">Pacific Trails Resort</span> <br /> 
 
       12010 Pacific Trails Road <br /> 
 
       Zephyr, CA 95555<br /><br /> 
 
       888-555-5555<br /> 
 
      </div> 
 

 
      </main> 
 

 
      <footer> 
 
      Copyright &copy; 2016 Pacific Trails Resort <br /> 
 
      <a href = "mailto:[email protected]">[email protected]</a> 
 
      </footer> 
 
     </div> 
 
    </body> 
 
</html>

答えて

0

まあそれは私が割り当てのための間違った絵を与えたが判明しました。正しい絵を描くことで、彼らは意図どおりになる。画像のサイズ、高さ、幅の寸法を常に確認してください。

関連する問題