Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [css] niewidoczny div bez zawartości
Forum PHP.pl > Forum > Po stronie przeglądarki
tomek_swat
witam,
jak zrobić by div, który nie ma zawartości, posiada tylko background zdefiniowany w css był widoczny?
pzdr
  1. <div id="header">
  2.                <div class="logo"></div><div class="head"></div>
  3. </div>
  4.  
  5. #header{
  6. width: 100%;
  7. height: 93px;
  8. margin: 0;
  9. background: #e7e7e7 url(../images/bg_header.gif) repeat-x;
  10. }
  11.  
  12. #header .logo{
  13. display: inline;
  14. clear: both;
  15. height: 91px;    
  16. width: 182px;
  17. background: #e7e7e7 url(../images/logo.gif) no-repeat;
  18.  
  19. }
  20. #header .head{
  21. display: inline;
  22. height: 91px;    
  23. width: 547px;
  24. background: #e7e7e7 url(../images/bg_head.gif) no-repeat;
  25. }
piotrooo89
spróbuj tak:

  1. #header
  2. {
  3. width: 100%;
  4. height: 93px;
  5. margin: 0;
  6. }
  7. #header .logo
  8. {
  9. clear: both;
  10. height: 91px;
  11. width: 182px;
  12. background: #e7e7e7 url(../6.jpg) no-repeat;
  13. float:left;
  14. }
  15. #header .head
  16. {
  17. height: 91px;
  18. width: 547px;
  19. background: #e7e7e7 url(../6.jpg) no-repeat;
  20. }
tomek_swat
nie działa poza tym w header potrzebny jest ten background a usunięcie inline spowodowało tylko, że nie wyświetlają się w jednym oknie, proszę o pomoc
pzdr
erix
Nie możesz nadać wysokości/szerokości dla elementu liniowego (wyjątek: obrazki) bez ustawienia opływania (np. float: left).
tomek_swat
dzięki, już mi działa
  1. #header{
  2. width: 760px;
  3. height: 93px;
  4. margin: 0;
  5. background: #e7e7e7 url(../images/bg_header.gif) repeat-x;
  6. }
  7.  
  8. #header .logo{
  9. clear: both;
  10. height: 91px;    
  11. width: 182px;
  12. float: left;
  13. }
  14.  
  15. #header .head{
  16. float: left;
  17. height: 91px;    
  18. width: 547px;
  19. background: #e7e7e7 url(../images/bg_head.gif);
  20. }
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.