2016-08-31 3 views
0

私はHTMLとCSSでかなり新しいです。そして私はMagentoのウェブサイトにいくつかの変更を加えています。いくつかのトラブルに会った... ここにウェブサイトがあります。 website with problemフッター内のスペースを削除するには

フッタ領域には大きな空白があります。なぜ空白があるのか​​全く分かりません。私はすべての関連コードをここに入れるよう全力を尽くします。しかし、基本的には

<div class="footer-container<?php if($footerCssClasses) echo $footerCssClasses; ?>"> 
<div class="footer-container2"> 
    <div class="footer"> 


     <?php //Columns ---------------------------------------------------------------------------------- ?> 
     <?php 
     //Set minimum height of both footer columns ("footer-item") 
     $linksColumnHeight = trim($themeHelper->getCfgDesign('footer/links_column_wrapper_height')); 
     $colHeightStyle = ''; //CSS specifying main footer column height 
     if (is_numeric($linksColumnHeight)) { 
     $linksColumnHeight = (int) $linksColumnHeight; 
     if ($linksColumnHeight > 0) 
     //echo '<style>.footer-item { min-height:' . $linksColumnHeight . 'px; }</style>'; 
     $colHeightStyle = 'style="min-height:' . $linksColumnHeight . 'px;"'; 
    } 
    ?> 
    <?php 
    //Get 5 static CMS blocks "i_block_footer_links_column<X>", where <X> is a number from 1 to 5 
    $colCount = 0; //Number of existing column blocks 
    $colHtml = array(); //Columns' content 
    for ($i = 1; $i < 6; $i++) 
    { 
    if ($tmp_html = $this->getChildHtml('i_block_footer_links_column' . $i)) 
    { 
    //$colHtml .= '<div class="footer-links-column-wrapper">' . $tmp_html . '</div>'; 
    $colHtml[] = $tmp_html; 
    $colCount++; 
    } 
} 
?> 
<?php 
//Check if company info block exists 
$blockFooterCompanyHtml = $this->getChildHtml('i_block_footer_company'); 
?> 
<?php //If columns or company info block exist ?> 
<?php if ($colHtml || $blockFooterCompanyHtml != ''): ?> 
    <div class="footer-main-bottom clearer"> 

    <?php //If any of the 5 blocks exist, display HTML output inside a wrapper block ?> 
    <?php if ($colHtml): ?> 
     <div class="footer-item wide" <?php if($colHeightStyle) echo $colHeightStyle; ?>> 
     <?php 
     //Set column styles, if automatic width calculation is enabled 
     $colAuto = $themeHelper->getCfg('footer/links_column_auto_width'); 
     $colWidthStyle = ''; //CSS specifying single column width and margin 
     $colWidthStyleLastCol = ''; //CSS specifying single column width and margin for the last column 
     if ($colAuto && $colCount > 0) 
     { 
     //Calculate column and right margin width (percentage): 90% of space for column, 10% for margin 
     //If there is only 1 column: width equals 100%, right margin is 0 
     //IMPORTANT: Calculate margin only if there is more than 1 column (to avoid division by zero) 
     if ($colCount > 1) { 
     $colWidth = 90/$colCount; 
     $marginWidth = 10/($colCount - 1); //Subtract 1 because the last block has no right margin 
     } else { 
     $colWidth = 100; 
     $marginWidth = 0; 
    } 
    $colWidthStyle = 'style="width:' .$colWidth. '%; margin-right:' .$marginWidth. '%;"'; 
    $colWidthStyleLastCol = 'style="width:' .$colWidth. '%; margin-right:0;"'; 
    } 
    ?> 
    <?php for ($i = 0; $i < $colCount; $i++): ?> 
    <?php //If the last column: replace the width style with the width style for the last column 
    if ($i+1 == $colCount) 
    $colWidthStyle = $colWidthStyleLastCol; 
    ?> 
    <div class="footer-links-column-wrapper" <?php if($colWidthStyle) echo $colWidthStyle; ?>> 
     <?php echo $colHtml[$i]; ?> 
    </div> 
    <?php endfor; ?> 
    <script type="text/javascript">decorateGeneric($$('.footer-links-column-wrapper'), ['last'])</script> 
</div> 
<?php endif; ?> 

ページのソースに見ることができますこれは、フッターのコードの一部です。 コードの全体の一部は非常に非常に長いです...この部分の

CSS:

.footer-container { 
    background:url(../images/img/footer-gray.png) center 0 repeat; 
} 

.footer-container2 { 
    background:url(../images/img/footer-bg-top-line.png) center 0 repeat-x; 
} 

.footer { 
    width:960px; 
    margin:0 auto; 
    padding:0; 
    text-align:left; 
    background:url(../images/img/footer-bg-plus.png) center 50px no-repeat; 
    color:#555; /* DESIGN: footer text color */ 
} 

.footer a { 
    color:#555; /* DESIGN: footer link color */ 
} 
.footer a:hover { 
    color:#a60404; /* DESIGN: footer link color hover */ 
} 
.footer .heading { 
    color:#333; 
} /* DESIGN: footer heading color */ 

.mclear { clear:both; } /* my: additional simple clearing */ 

..だから任意の提案ですか? 背景イメージが小さすぎると思っていましたか?実際には繰り返しています。だからこの推測は間違っている。

.footer { 
    background:url(../images/img/footer-bg-plus.png) center 50px no-repeat; 
} 

がそれを削除し、あなたは問題ないはずです。

+0

それが原因であなたのフッター項目の広いクラスに設定MIN-heightプロパティ、である '.footer-container2'と' .footer'クラス –

+0

から削除背景。あなたはそれを削除して所望の出力を得ることができます – Shrikant

+0

こんにちは、お返事をいただきありがとうございます。既に固定されています。どうもありがとう! – maggie3003

答えて

0

空白の背景画像は.footer-container2クラスです。ただそれを削除します。

.footer-container2 { 
    background:url(../images/img/footer-bg-top-line.png) center 0 repeat-x; 
} 

また、.footerクラスのシャドーイメージです。これも削除してください。

+0

あなたは素晴らしいです!どうもありがとう! – maggie3003

+0

それが動作する場合は答えとして受け入れてください..ありがとう –

0

あなたのフッターには、背景が設定されています。

+0

作品!どうもありがとう!! – maggie3003

+0

これを受け入れる答えとして選択していただければ幸いです。ありがとうございます。 – morre

0

140pxを最小幅として記載したスクリーンショットを確認してください。それを削除してください。

https://snag.gy/8YrXCJ.jpg

0

これは、あなたが最初のスタイルを下回る.footer-item.wideする

.footer-item.wide { 
width: 100%; 
min-height: auto !important; 
box-sizing: border-box; 
} 
+0

返信ありがとうございます。しかし、これは私が望むものではありません。私はすでにMukeshのおかげでそれを修正しました。とにかくありがとう。感謝! – maggie3003

0

を追加してくださいenter image description here

を望んでいた方法である場合。私は.foooter-bottompadding20pxです。上から例えば0に変更してください。 padding: 0 0 20px 20px; 20pxを下にして左にしたい場合。

秒です。.footer-itempadding変更埋め込みなど。 50px 0 0 20px;

最後にここにあなたのコードを見て:あなたは、ホワイトスペースを減らしたい場合はmin-heightプロパティを必要としない

<div class="footer-main-bottom clearer"> 
    <div class="footer-item wide" style="min-height: 140px;">... 

。例: 〜90px。他のdivの不具合paddingmarginのプロパティを削除することもできます。ブラウザのコードインスペクタ(Mozilla Firefoxなど)を使用するだけです。

これは上記のヒントの効果です。 enter image description here

関連する問題