PDA

Zobacz pełną wersję : Uciekający nagłówek



mbx
24-06-2008, 20:52
Kiedy ukrywam e prawą kolumnę, nagłówek przesuwa sie w prawo. Jak sa dwie kolumny wszystko jest OK.

body {
padding : 0;
margin : 0;
background-color: #F8F8F8; /* kolor całej strony */
color : #000;
text-align : center; /* wyśrodkuj stronę - dla IE*/
min-width : 782px; /* dla Mozilli = 2px więcej niż #content*/
font : 76.1% Verdana, Arial, Helvetica, sans-serif;
}
#content{
position : relative;
height : 100%;
min-height : 100%;
width : 780px;
border-left : 1px solid #888;
border-right : 1px solid #888;
color : #000;
background : url(../images/centredbg.png) repeat-y 50% 50%; /* tło kolumn */
margin : auto; /* wyśrodkuj stronę */
text-align : left; /* przywróć justowanie tekstu do lewej */
}
#nav_bar {
float : left;
position : relative; /* dla IE - rozwiązuje problemy
z wyświetlaniem elementów pływających */
width : 190px; /* mniej o 2 px na border */
padding-top : 120px; /* miejsce na nagłówek */
padding-bottom : 32px; /* oddala nieco stopkę */
}
#misc_bar {
float : right;
position : relative;
width : 190px; /* mniej o 2 px na border */
padding-top : 120px; /* miejsce na nagłówek */
padding-bottom : 32px; /* oddala nieco stopkę */
}

#content_nav_ext {
float : left;
width : 590px; /* = #content - #misc_bar */
}
#header{
position : absolute;
top : 0;
width : 780px;
height : 120px;
background : #FFF url(../images/header.jpg) no-repeat;
border : 1px solid #888;
}

#footer {
clear : both;
position : absolute;
left : 0;
bottom : 0;
width : 780px;
height : 50px;
border-top : 1px solid #888;
border-bottom : 1px solid #888;
background-color: #EAF0FE;
text-align : center;
}
#content_main {
width : 400px; /* = #content - #nav_bar - #misc_bar*/
float : right; /* ustawia margines od lewej */
padding-top :120px; /* miejsce na nagłówek */
padding-bottom : 32px; /* oddala nieco stopkę */
}
#content_main_ext {
position : absolute;
top : 120px;
left : 198px;
width : 582px;
}

#clear_footer { /* czyści obszar dla stopki */
width : 100%;
height : 52px;
clear : both;
}

/*=================== ŁATKI ======================== */
/* tu będą umieszczane łatki */
html > body #content{
height : auto; /* dla Mozilli, IE zawsze traktuje height jako min-height*/
}
* html #footer { /* Style tylko dla IE */
height : 52px; /* dla IE5 */
height : 50px; /* dla IE6 */
}
/*=============== KONIEC ŁATEK ===================== */

/* ========== TYLKO DLA PODGLąDU =================== */
h1 { /* Ukrywa wyświetlanie nazwy w nagłówku strony */
display: none;
}
#nav_bar,#misc_bar {
background-color: #F2F2F2; /* tło w obszarze wypełnionym zawartością */
}

moje
25-06-2008, 11:46
Musisz to wstawić

<?php if ( mosCountModules( 'right' ) <= 0) { ?>
<style type="text/css" media="screen">
/* tu podajemy dodatkowe style korygujące wymiary elementów szablonu w przypadku, gdy w pozycji 'right' nie ma opublikowanego żadnego modułu */
</style>
<?php } ?>
W taki sposób możesz wstawić kod stylu z dodatkowym prawym marginesem dla nagłówka.

mbx
25-06-2008, 12:21
Tak wygląda mój index.php, dodam jeszcze że problem pojawia sie tylko w Internet Explorer

<body>
<div id="content">
<?php
if ( ( mosCountModules('right') != 0) && ($_REQUEST['task'] != 'edit')) { ?>

<!-- pokaz -->
<div id="content_nav_ext">
<div id="content_main"> <!--najpierw glówna tresc -->
<?php mosMainBody(); ?>
</div>



<div id="nav_bar">
<?php mosLoadModules( 'left' ); ?>
<?php if (mosCountModules('user1')) { ?>
<?php mosLoadModules( 'user1');?>
<?php } ?>
<?php if (mosCountModules('user2')) { ?>
<?php mosLoadModules( 'user2');?>
<?php } ?>
</div>
</div> <!-- koniec content_nav_ext -->
<div id="misc_bar">
<?php mosLoadModules( 'right' ); ?>
<?php if (mosCountModules('user5')) { ?>
<?php mosLoadModules( 'user5');?>
<?php } ?>
<?php if (mosCountModules('user6')) { ?>
<?php mosLoadModules( 'user6');?>
<?php } ?>
</div>


<div id="clear_footer"></div> <!-- oczysza miejsce na stopke -->
<div id="header">
<h1><?php echo $GLOBALS['mosConfig_sitename']; ?></h1>
</div>
<div id="footer">
<?php include_once($GLOBALS['mosConfig_absolute_path']
. '/includes/footer.php'); ?>
</div>
<!-- koniec I czesci instrukcji -->
<?php
} else { ?>
<!-- Tylko 2 kolumny -->
<!-- w przeciwnym przypadku pokaz -->
<div id="content_nav_ext">
<div id="content_main_ext">
<?php mosMainBody(); ?>

</div>

<div id="nav_bar">
<?php mosLoadModules( 'left' ); ?>
<?php if (mosCountModules('user1')) { ?>
<?php mosLoadModules( 'user1');?>
<?php } ?>
<?php if (mosCountModules('user2')) { ?>
<?php mosLoadModules( 'user2');?>
<?php } ?>
</div>
</div> <!-- koniec content_nav_ext -->
<div id="header">
<h1><?php echo $GLOBALS['mosConfig_sitename']; ?></h1>
</div>
<div id="footer">
<?php include_once($GLOBALS['mosConfig_absolute_path']
. '/includes/footer.php'); ?>
</div>
<?php
}
?>
<!-- koniec II czesci instrukcji -->


</div> <!-- koniec ramki: #content -->
</body>

moje
25-06-2008, 19:39
Musisz ustawić odpowiedni margines dla tego nagłówka w pliku css dla opcji z tylko 2 kolumnami.

EDIT:

To: http://www.forumweb.pl/viewtopic.php?t=22422 i to: http://www.pomoc.joomla.pl/content/view/596/46 Ci sie przyda :)