3

以下はSafariブラウザの問題です。Chromeで問題なく動作します。グリッド ベースのポートフォリオ サイトに取り組んでいますが、コンテンツが非表示になるという問題があります。現在、3 x 4 グリッドの最後の 3 つのタイルが切り取られています。スクロールしたときにそれらを表示する方法はありますか? ありがとう!

デモ: www.mindtale.com/portfolio.html

portfolo.html

<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="style2.css"> 
<title>Mindtale Test Home</title>
</head>

<body>




<!-- Header -->

<div id="headerlogo">
<a href="index.html"><img src="images/logo.png"></a></div>

<div id="headerfill"></div>
<div id="header"></div>

<div id="headerlink1">

<a href="portfolio.html">Portfolio</a>
</div>

<div id="headerlink2">
<a href="contact.html">Contact</a>
</div>


<!-- Content -->


<div id="gridcontainer">

<div id="portfolio-grid">

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://news.bbc.co.uk" target="_blank">BBC News</a></div>
    <div class="website-url"><a href="http://news.bbc.co.uk" target="_blank">http://news.bbc.co.uk</a></div>
    <div class="website-description">A popular destination for up-to-date news in the UK and around the World.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://www.envirogadget.com" target="_blank">EnviroGadget</a></div>
    <div class="website-url"><a href="http://www.envirogadget.com" target="_blank">http://www.envirogadget.com</a></div>
    <div class="website-description">One of Dan's websites focusing on the best of eco-friendly gadgets.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://www.google.co.uk" target="_blank">Google</a></div>
    <div class="website-url"><a href="http://www.google.co.uk" target="_blank">http://www.google.co.uk</a></div>
    <div class="website-description">The search engine that most people use.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://news.bbc.co.uk" target="_blank">BBC News</a></div>
    <div class="website-url"><a href="http://news.bbc.co.uk" target="_blank">http://news.bbc.co.uk</a></div>
    <div class="website-description">A popular destination for up-to-date news in the UK and around the World.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://www.envirogadget.com" target="_blank">EnviroGadget</a></div>
    <div class="website-url"><a href="http://www.envirogadget.com" target="_blank">http://www.envirogadget.com</a></div>
    <div class="website-description">One of Dan's websites focusing on the best of eco-friendly gadgets.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://www.google.co.uk" target="_blank">Google</a></div>
    <div class="website-url"><a href="http://www.google.co.uk" target="_blank">http://www.google.co.uk</a></div>
    <div class="website-description">The search engine that most people use.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://news.bbc.co.uk" target="_blank">BBC News</a></div>
    <div class="website-url"><a href="http://news.bbc.co.uk" target="_blank">http://news.bbc.co.uk</a></div>
    <div class="website-description">A popular destination for up-to-date news in the UK and around the World.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://www.envirogadget.com" target="_blank">EnviroGadget</a></div>
    <div class="website-url"><a href="http://www.envirogadget.com" target="_blank">http://www.envirogadget.com</a></div>
    <div class="website-description">One of Dan's websites focusing on the best of eco-friendly gadgets.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://www.google.co.uk" target="_blank">Google</a></div>
    <div class="website-url"><a href="http://www.google.co.uk" target="_blank">http://www.google.co.uk</a></div>
    <div class="website-description">The search engine that most people use.</div>
    <div class="website-clear"></div>
</div>


<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://news.bbc.co.uk" target="_blank">BBC News</a></div>
    <div class="website-url"><a href="http://news.bbc.co.uk" target="_blank">http://news.bbc.co.uk</a></div>
    <div class="website-description">A popular destination for up-to-date news in the UK and around the World.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://www.envirogadget.com" target="_blank">EnviroGadget</a></div>
    <div class="website-url"><a href="http://www.envirogadget.com" target="_blank">http://www.envirogadget.com</a></div>
    <div class="website-description">One of Dan's websites focusing on the best of eco-friendly gadgets.</div>
    <div class="website-clear"></div>
</div>

<div class="portfolio-website">
    <div class="website-thumbnail"><a href="http://news.bbc.co.uk" target="_blank"><img src="images/gridimg1.png" alt="BBC News"></a></div>
    <div class="website-name"><a href="http://www.google.co.uk" target="_blank">Google</a></div>
    <div class="website-url"><a href="http://www.google.co.uk" target="_blank">http://www.google.co.uk</a></div>
    <div class="website-description">The search engine that most people use.</div>
    <div class="website-clear"></div>
</div>

</div>



<!-- <div id="content">
<h2>A random heading</h2>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>
<p>Content Placeholder ... </p>

</div> -->

<!-- Footer -->

<div id="footer">
Mindtale &copy; 2013
</div>

</body>

スタイル.css

html { 
height:100%; /* fix height to 100% for IE */
max-height:100%; /* fix height for other browsers */
background: url(images/bg.jpg) no-repeat center center fixed; /* add background image */
-webkit-background-size: cover; /* fix height for other browsers */
-moz-background-size: cover; /* fix height for other browsers */
-o-background-size: cover; /* fix height for other browsers */
background-size: cover; /* fix height for other browsers */
}

/* Header */
/* -------------------------------------------------- */



div#header {
z-index:3;
position:fixed;
background: url(images/header.png) no-repeat center;
height: 102px;
top:0px;
left:0px;
width:100%;
padding: 0px;
}

div#headerfill {
z-index:4;
position:fixed;
background: url(images/headerfill.png) repeat-x;
height: 98px;
top:0px;
left:0px;
width:100%;
padding: 0px;
}

div#headerlink1 {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size:90%;
z-index:4;
position:fixed;
top:55px;
left:18%;
color:#999;
padding: 0px;
}

div#headerlink2 {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size:90%;
z-index:4;
position:fixed;
top:55px;
left:78%;
color:#999;
padding: 0px;
}

div#headerlogo {
z-index:5;
position:fixed;
top:30px;
left:42%;
color:#999;
padding: 0px;
}

/* Content */
/* -------------------------------------------------- */

div#content {
position:fixed;
width:100%;
color:#222;
top: 70px; 
bottom: 0; 
left: 0; 
right: 0;
padding: 25px;
overflow: auto;



font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;

}


/* Footer */
/* -------------------------------------------------- */

div#footer {
position:fixed;
bottom:0px;
left:0px;
width:100%;
color:#999;
background:#333;
padding: 8px;
}
4

3 に答える 3

4

This is because you have a footer that has a CSS property of position:fixed;. This takes the footer out of the element flow, making the content that comes just before the footer hide behind the footer.

Try adding padding-bottom:50px; to div#gridcontainer, like so:

#gridcontainer {
    top: 150px;
    bottom: 100px;
    position: relative;
    overflow: hidden;
    width: 996px;
    margin: 0 auto;
    padding-bottom: 50px;
}
于 2013-04-18T20:06:43.273 に答える
2

これを解決する別のセマンティックではない方法 (ただし、上記のパディング ソリューションの方が優れています):

固定フッターは DOM フローから削除されたので、フッターが何をブロックしているのかが問題にならないように、フッターの前にある div の下部にスペースを追加する必要があります。

最後のポートフォリオ Web サイト div の後に別の要素を追加することで、必要なパディングを作成できます。

<div class="spacer">
</div>

次に、ある程度の高さを与えてクリアします。

.spacer {
  clear: both;
  height: 50px;
}
于 2013-04-18T20:18:48.323 に答える
1

以下は、Safari の固定フッターのオーバーラップ コンテンツで機能します。

#gridcontainer {
    top: 150px;
    bottom: 100px;
    position: overflow;
    overflow: hidden;
    width: 996px;
    margin: 0 auto;
    padding-top: 150px;
    padding-bottom: 50px;
}

Safari の場合、位置 -> オーバーフローが必要です。必要な画面の領域に表示されるように、コンテンツのパディングを指定します。

于 2013-04-18T21:44:04.397 に答える