PDA

Zobacz pełną wersję : DIV w divie jak nadać tło



GrupaAF
04-04-2013, 18:09
Witam Forumowicze, zwracam się z prośbą o pomoc.
Div w div'ie : Problem polega na tym, że div, który ma być na wierzchu, jest pod spodem drugiego diva. Nie wiem, jak to zapisać , żeby dobrze się wyświetlało we wszystkich przeglądarkach. Na IE9 wygląda dobrze, a tymczasem na innych mój div górny chowa się w dół. Proszę o pomoc. ;)

Bazyl
04-04-2013, 18:20
Google - z-index

GrupaAF
04-04-2013, 19:43
Z-index nie rozwiąże w tym przypadku problemu, jest już ustawiony. Podaję fragment kodu. real-content powinien być spodem, a div user1,user2,user3 mają być na real-content:
<div id="realContent">
<jdoc:include type="component" />
<?php if ($this->countModules('user1')): ?>
<div id="user1">
<div id="topuser1"></div>
<div id="centeruser1">
<jdoc:include type="modules" name="user1" style="xhtml" />
</div>
<div id="bottomuser1"></div>
</div>
<?php endif; ?>
<?php if ($this->countModules('user2')): ?>
<div id="user2">
<div id="topuser2"></div>
<div id="centeruser2">
<jdoc:include type="modules" name="user2" style="xhtml" />
</div>
<div id="bottomuser2"></div>
</div>
<?php endif; ?>
<?php if ($this->countModules('user3')): ?>
<div id="user3">
<div id="topuser3"></div>
<div id="centeruser3">
<jdoc:include type="modules" name="user3" style="xhtml" />
</div>
<div id="bottomuser3"></div>
</div>
<?php endif; ?>

</div>

Jdwind
04-04-2013, 20:00
Za wiele nam to nie powie, ponieważ wspomniane divy masz zawarte w realContent. Ważny w tym przypadku jest CSS, jeśli używasz z-index dla pozycji musisz użyć też pozycjonowania (position: relative lub absoulte w tym wypadku zapewne) inaczej z-index nie zadziała.