2016-01-09 3 views
0

В настоящее время я использую Joomla с настраиваемым шаблоном, который я разработал. Большинство из них прекрасно работают, но у меня большая проблема с нижним колонтитулом: он отображается в середине страницы, если контент длиннее определенной высоты. У меня есть нижний колонтитул с абсолютным значением с нижним значением 0, поэтому я не могу понять, почему он появится на некоторых страницах. Ниже приведено содержимое custom.css и index.php моего шаблона для справки. Также см. Скриншоты ниже. Первая показывает страницу с правильно расположенным нижним колонтитулом, в то время как другие два подчеркивают проблему нижнего колонтитула. Спасибо заранее за любую помощь!Footer in Custom Joomla Template

custom.css

@charset "utf-8"; 
/* Wowcrofty's Picture Perfect Custom Layout */ 

/* CSS Descriptor properties order: 
    1. Positioning properties 
    2. Width and height properties 
    3. Margin and padding properties 
    4. Border and box properties 
    5. Background properties 
    6. Text properties */ 


/* HTML tag styling */ 

body { 
    width: 100%; 
    height: 100%; 
    background-color: #FF8000; 
    font-family:Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif; 
} 

a {color: #000;} 

a:visited {color: #FF8000;} 

h1 { 
    font-size: 28px; 
} 

h2 { 
    font-size: 24px; 
} 

h3 { 
    font-size: 18px; 
} 

header { 
    width: 99%; 
    height: 310px; 
    padding-top: 20px; 
    background-color: #000; 
    text-align: center; 
} 

footer { 
    position: absolute; 
    bottom: 0; 
    width: 100%; 
    height: 40px; 
    border-bottom-left-radius: 10px; 
    border-bottom-right-radius: 10px; 
    background-color: #000; 
    line-height: 2; 
    color: #fff; 
    font-style: italic; 
    text-align: center; 
} 


/* Navigation Styling */ 

nav { 
    text-transform: uppercase; 
} 


.navbar-inner { 
    min-height: 40px; 
    padding-left: 20px; 
    padding-right: 20px; 
    background-color: #000; 
    background-image: -moz-linear-gradient(top, #000, #000); 
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#000), to(#000)); 
    background-image: -webkit-linear-gradient(top, #000, #000); 
    background-image: -o-linear-gradient(top, #000, #000); 
    background-image: linear-gradient(to bottom, #000, #000); 
    background-repeat: repeat-x; 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000', endColorstr='#000', GradientType=0); 
    border: 0px solid #d4d4d4; 
    -webkit-border-radius: 0; 
    -moz-border-radius: 0; 
    border-radius: 0; 
    -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); 
    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); 
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); 
} 

.navbar .nav > li > a { 
    float: none; 
    padding: 10px 15px 10px; 
    -moz-border-top-left-radius: 6px; 
    -webkit-border-top-left-radius: 6px; 
    border-top-left-radius: 6px; 
    -moz-border-top-right-radius: 6px; 
    -webkit-border-top-right-radius: 6px; 
    border-top-right-radius: 6px; 
    color: #fff; 
    text-decoration: none; 
    font-size: 18px; 
    text-shadow: 0 -1px 0 #000; 
} 

.navbar .nav > li > a:focus, 
.navbar .nav > li > a:hover { 
    background-color: transparent; 
    color: #FF8000; 
    text-decoration: none; 
} 

.navbar .nav > .active > a, 
.navbar .nav > .active > a:hover, 
.navbar .nav > .active > a:focus { 
    color: #000; 
    text-decoration: none; 
    background-color: #FF8000; 
    -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); 
    -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); 
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); 
} 

nav .nav-child { 
    position: absolute; 
    top: 95%; 
    left: 0; 
    z-index: 1000; 
    display: none; 
    float: left; 
    min-width: 160px; 
    padding: 5px 0; 
    margin: 2px 0 0; 
    list-style: none; 
    background-color: #FE642E; 
    border: 1px solid #ccc; 
    border: 1px solid rgba(0,0,0,0.2); 
    *border-right-width: 2px; 
    *border-bottom-width: 2px; 
    -webkit-border-radius: 6px; 
    -moz-border-radius: 6px; 
    border-radius: 6px; 
    -webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.2); 
    -moz-box-shadow: 0 5px 10px rgba(0,0,0,0.2); 
    box-shadow: 0 5px 10px rgba(0,0,0,0.2); 
    -webkit-background-clip: padding-box; 
    -moz-background-clip: padding; 
    background-clip: padding-box; 
} 
nav .nav-child.pull-right { 
    right: 0; 
    left: auto; 
} 
nav .nav-child .divider { 
    *width: 100%; 
    height: 1px; 
    margin: 8px 1px; 
    *margin: -5px 0 5px; 
    overflow: hidden; 
    background-color: #e5e5e5; 
    border-bottom: 1px solid #fff; 
} 
nav .nav-child a { 
    display: block; 
    padding: 3px 20px; 
    clear: both; 
    font-size: 13px; 
    font-weight: normal; 
    line-height: 18px; 
    color: #fff; 
    white-space: nowrap; 
} 
nav .nav > li { 
    position: relative; 
} 
nav .nav > li:hover > .nav-child, 
nav .nav > li > a:focus + .nav-child { 
    display: block; 
} 
nav .nav-child:before { 
    position: absolute; 
    top: -7px; 
    left: 9px; 
    display: inline-block; 
    border-right: 7px solid transparent; 
    border-bottom: 7px solid #FE642E; 
    border-left: 7px solid transparent; 
    border-bottom-color: rgba(0,0,0,0.2); 
    content: ''; 
} 
nav .nav-child:after { 
    position: absolute; 
    top: -6px; 
    left: 10px; 
    display: inline-block; 
    border-right: 6px solid transparent; 
    border-bottom: 6px solid #FE642E; 
    border-left: 6px solid transparent; 
    content: ''; 
} 
nav .nav-child li > a:hover, 
nav .nav-child li > a:focus, 
nav .nav-child:hover > a { 
    text-decoration: none; 
    color: #000; 
    background-color: transparent; 
} 


/* User Bar Styling */ 

#userheader { 
    width: 100%; 
    min-height: 25px; 
    max-height: 45px; 
    padding: 3px 8px; 
    border-top-left-radius: 10px; 
    border-top-right-radius: 10px; 
    background-color: #BDBDBD; 
} 

.userdata .control-group{ 
    position: relative; 
    top: -12px; 
    left: 0; 
    float:left; 
} 

#form-login-remember { 
    position: absolute; 
    top: 14px; 
    left: 340px; 
} 

form ul.unstyled { 
    position: absolute; 
    top: 55px; 
    left: 10px; 
    display: none; 
    list-style: none; 
} 

.logout { 
    position: relative; 
    top: -10px; 
    left: 55px; 
    float: left; 
} 

.search { 
    position: relative; 
    top: 6px; 
} 


/* Component Styling */ 

.breadcrumb { 
    -moz-border-radius: 6px; 
    -webkit-border-radius: 6px; 
    border-radius: 6px; 
    background-color: #BDBDBD; 
    color: #000; 
} 

#componentcontainer { 
    width: 99%; 
    height: auto; 
    margin: 0 auto; 
    padding: 15px; 
    border: 2px #000 solid; 
    background-color: #fff; 
} 


/* Button Styling */ 
.btn-primary { 
    color: #ffffff; 
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 
    background-color: #000; 
    background-image: -moz-linear-gradient(top, #000, #6E6E6E); 
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#000), to(#6E6E6E)); 
    background-image: -webkit-linear-gradient(top, #000, #6E6E6E); 
    background-image: -o-linear-gradient(top, #000, #6E6E6E); 
    background-image: linear-gradient(to bottom, #000, #6E6E6E); 
    background-repeat: repeat-x; 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000', endColorstr='#6E6E6E', GradientType=0); 
    border-color: #0044cC#0044cC#002a80; 
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 
    *background-color: #000; 
    /* Darken IE7 buttons by default so they stand out more given they won't have borders */ 

    filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 
} 
.btn-primary:hover, 
.btn-primary:active, 
.btn-primary.active, 
.btn-primary.disabled, 
.btn-primary[disabled] { 
    color: #ffffff; 
    background-color: #000; 
    *background-color: #000; 
} 

#contentheader { 
    position: relative; 
    top: 20px; 
    width: 55%; 
    height: 55px; 
    margin: 0 auto; 
    padding: 10px; 
    border-radius: 10px; 
    box-shadow: -1px -3px 2px #CDC7C7; 
    background-color: #000; 
    font-size: 36px; 
    color: #fff; 
    font-weight: bold; 
    text-align: center; 
} 

#content { 
    position:relative; 
    top: 35px; 
    background-color: transparent; 
    font-size: 36px; 
    text-align: center; 
} 

.bodycontent { 
    position: relative; 
    top: 175px; 
    width: 97%; 
    margin: 0 auto; 
    padding: 10px 0 20px 0; 
    border-radius: 10px; 
    box-shadow: -2px -2px 1px #ADA0A0; 
    background-color: #FD1115; 
    font-size: 26px; 
    line-height: 2; 
    color: #fff; 
    text-align: center; 
} 

/*News Ticker Styles*/ 

#news { 
    width: 95%; 
    margin: 0 auto; 
    box-shadow: -1px -1px 1px #fff; 
    background-color: #fff; 
    color: #000; 
} 

.date { 
    margin-top: 10px; 
    padding-top: 6px; 
    font-size: 18px; 
    font-weight: bold; 
    color: #000; 
    text-align: center; 
} 

.headline { 
    font-size: 24px; 
    font-weight: bold; 
    background-color: transparent; 
    color #000; 
    text-align: center; 
} 

.headlinebody { 
    margin-top: 10px; 
    font-size: 16px; 
    font-weight: normal; 
    color: #000; 
    text-align: center; 

index.php

<?php 
// Wowcrofty's Picture Perfect Photo Custom Joomla Template for v3.3 


// Check that the template is being installed in Joomla. 
defined('_JEXEC') or die; 

// Add Joomla JavaScript Frameworks 
JHtml::_('bootstrap.framework'); 

// Load Bootstrap stylesheets 
JHtmlBootstrap::loadCss($includeMaincss = true); 
?> 

<!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<jdoc:include type="head" /> 

<!--[if lt IE 9]> 
     <script src="<?php echo $this->baseurl ?>/media/jui/js/html5.js"></script> 
    <![endif]--> 

<link href="templates/wowcroftypictureperfect/css/custom.css" rel="stylesheet" type="text/css"> 
</head> 

<body> 
    <div id="userheader" class="row-fluid"> 
     <div class="row-fluid"> 
      <div class="span9"><jdoc:include type="modules" name="userinfo" style="html5" /></div> 
      <div class="span3"><jdoc:include type="modules" name="search" style="html5" /></div> 
     </div> 
    </div> 

    <header class="row-fluid"> 
     <div class="span12"> 
      <a href="/"><img src="templates/wowcroftypictureperfect/images/headerbanner.png" alt="Wowcrofty's Picture Perfect Photo, click to go home." /></a> 
     </div> 
    </header> 

    <div class="row-fluid"> 
    <nav class="span12 navbar"> 
    <div class="navbar-inner"> 
     <div class="container-fluid"> 
     <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> 
      <span class="icon-bar"></span> 
      <span class="icon-bar"></span> 
      <span class="icon-bar"></span> 
     </a> 
     <div class="nav-collapse collapse"> 
      <jdoc:include type="modules" name="nav" style="none" /> 
     </div> 
     </div> 
    </div> 
    </nav> 
</div> 
    <div id="componentcontainer" class="row-fluid"> 
     <?php if ($this->countModules('breadcrumbs')) : ?> 
      <div class="row-fluid"> 
       <div class="span12"><jdoc:include type="modules" name="breadcrumbs" style="html5" /></div> 
      </div> 
     <?php endif; ?> 
     <?php if ($this->countModules('componentheadermodule')) : ?> 
      <div class="row-fluid"> 
       <div class="span12"> 
        <jdoc:include type="modules" name="componentheadermodule" style="html5" /></div> 
     <?php endif; ?> 
      <div class="row-fluid"> 
       <div class="span12"> 
        <jdoc:include type="message" /> 
        <jdoc:include type="component" /> 
       </div> 
      </div> 
    </div> 
    <footer id="footer" class="row-fluid"> 
     <div class="span9"><jdoc:include type="modules" name="bottomnav" style="html5" /></div> 
     <div class="span3">Copyright &copy; <?php echo date("Y") ?> Matthew Croft. All rights reserved.</div> 
    </footer> 
</body> 
</html> 

Correctly positioned footer

Incorrectly positioned footer

Incorrectly positioned footer

ответ

0

Вы можете попробовать установить нижний колонтитул в относительный и # footer.span3 на абсолютный. Я бы тоже попытался использовать float. Обычно я отлаживаю этот тип материалов с помощью Chrome Inspector.