Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
[Css] problem z tłem w divach
#1
Witam!

mam problem z divami, mianowicie robiac strone podzielilem ja na 4 czesci dwie na górze to loga, a nizej #menu i #tresc, problem polega na tym ze tlo w menu i tresci jest obrazkowe i gdy np: w #tresci jest wiecej napisow niz w # menu to niestety tlo nemu nie rozciaga sie rownomiernie z #trescia, jak mozna to zmienic?

Oto kod Css
Kod:
html, body {
    background-color: #F1D8AE;
    color: #000;
    margin: 0;
    padding: 0;
}



#razem{
   background-color: #F1D8AE;

   padding: 0;
}

#logol{
margin-left: 12%;
width:265px;
height: 257px;
float: left;
overflow: hidden;
position: relative;
background-image: url(logol.jpg);
background-repeat: no-repeat;
}

#logo{
float: left;
width: 629px;
overflow: hidden;
position: relative;
height: 257px;
background-image: url(logo.jpg);
background-repeat: no-repeat;}



#menu{

margin-left: 12%;
float: left;
background-image: url(menu.jpg);
background-repeat: repeat-y;
width: 265px;
overflow: hidden;
position: relative;}



#tresc{

float: left;
width: 629px;
overflow: hidden;
position: relative;

background-image: url(tresc.jpg);
background-repeat: repeat-y}

kod html
Kod:
<BODY>
<div id="razem">
<div id="logol"></div>
<div id="logo"></div>
<div id="page">
<div id="menu">
<div align="center">
<br>Tresc
<br>Tresc
<br>Tresc
<br>Tresc
<br>Tresc
<br>Tresc
<br>Tresc

  </div align>

</div>
<div id="tresc">
<div align="center">
<br>Tresc
<br>Tresc
<br>Tresc
  </div align>
  </div>

</div>
<div id="stopka"></div>
<div id="stopka1">Design by Zabir</div>

</BODY>
</HTML>
Odpowiedz
#2
mozesz np zrobic tak:

Kod:
html, body {
    background-color: #F1D8AE;
    color: #000;
    margin: 0;
    padding: 0;
}



#razem{
    float:left;
   background-color: black;
height:100%;
   padding: 0;

  
}

#logol{
margin-left: 12%;
width:265px;
height: 257px;
float: left;
overflow: hidden;
background-color: yellow;
background-repeat: no-repeat;
}

#logo{
float: left;
width: 629px;
overflow: hidden;
height: 257px;
background-color:black;
background-repeat: no-repeat;}



#menu{

margin-left: 12%;
float: left;
background-color:green;
background-repeat: repeat-y;
width: 265px;
overflow: hidden;
height: 55%;

}



#tresc{

float: left;
width: 629px;
overflow: hidden;
height: 55%;

background-color:blue;
background-repeat: repeat-y}

#stopka{
clear:both;
background-color:aqua;
text-align:right;
}


Kod:
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="styl.css" />
</head>

<body>

<div id="logol"></div>
<div id="logo"></div>


<div id="menu">
<div align="center">
<br/>Tresc
<br/>Tresc
<br/>Tresc
<br/>Tresc
<br/>Tresc
<br/>Tresc
<br/>Tresc

  </div>

</div>
<div id="tresc">
<div align="center">
<br/>Tresc
<br/>Tresc
<br/>Tresc

  </div>
  </div>



<div id="stopka">Design by Zabir</div>

</body>
</html>
Odpowiedz
#3
Ale w Twoim sposobie jest problem taki ze ograniczam ilosc dodawania tekstu, a ja chce, aby obie strony byly rownomiernie wysokie, bez wzgledu na tresc, a gdy tresc jest wieksza niz rozmiar strony to nie ucinalo mi jej.

Chciałbym jeszcze zapytac jak wysrodkowac wszystkie divy na srodek strony, dodam ze margin:0 auto nie dziala, marginesy sie zmieniaja pod roznymi rozdzielczosciami ekranu, a ja chcialbym wysrodkowac bez wzgledu na rozdzielczosc.
Odpowiedz


Podobne wątki…
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
  problem z tłem pod menu loose 1 3,157 06-07-2017, 20:00
Ostatni post: loose
  Problem z background'em w divach i z-index iluminatix 1 2,166 30-04-2013, 21:34
Ostatni post: b3zyr
  Problem z float w dwóch divach obok siebie VuQ 4 3,971 02-10-2011, 23:57
Ostatni post: Kartofelek
  [XHTML]Problem z Tłem sestems 6 5,316 30-06-2011, 21:04
Ostatni post: sestems
  Dwie kolumny z jednym tłem w CSS. groobyy88 5 5,043 30-05-2011, 02:07
Ostatni post: groobyy88

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl