Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> ramka w php
Leech
post
Post #1





Grupa: Zarejestrowani
Postów: 27
Pomógł: 0
Dołączył: 26.07.2007

Ostrzeżenie: (0%)
-----


witam,
zrobilem strone na ramkach za pomocą position:absolute. Naglowek, stopka i lewy bok sa nieruchome natomiast srodkowy div jest plynny za pomocą overflow:auto. Jednak zeby mozna bylo scrollowac srodkowa ramke trzeba ustawic stala wysokosc. Wszystko byloby w porzadku ale przy zmianie rozdzielczosci nieruchome divy zaslaniaja czesc srodkowego okna. Procentowe ustawienie wysokosci nie zdaje egzaminu. Pytanie jak ustawic height ktore ma byc stale ale zmieniajace sie po zmienie rozdzielczosci. Istnieje sposob np w JS zeby pobrac wysokosc ekranu i wstawienie jej do CSS?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
michalkjp
post
Post #2





Grupa: Zarejestrowani
Postów: 182
Pomógł: 14
Dołączył: 20.09.2008

Ostrzeżenie: (0%)
-----


Nie wiem jak zrobić, aby bezpośrednio zmienić CSS, ale można zmienić styl dla określonego tagu po jego ID. To działa na FF, Operze, Safari, na IE6 nie chodzi, pewnie wymaga jakichś poprawek.

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <?xml-stylesheet href='css/style.css' type='text/css'?>
  3. <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
  4. <html xmlns='http://www.w3.org/1999/xhtml' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xml:lang='en'>
  5. <title>Test</title>
  6. <meta http-equiv='content-type' content='text/html; charset=utf-8' />
  7. <link rel='stylesheet' href='css/style.css' type='text/css' />
  8. <script type='text/javascript'>
  9. function set_res()
  10. {
  11. if (window.innerHeight) {
  12. height = window.innerHeight;
  13. width = window.innerWidth;
  14. } else if (document.body.scrollHeight > document.body.offsetHeight) {
  15. height = document.body.scrollHeight;
  16. width = document.body.scrollWidth;
  17. } else {
  18. height = document.body.offsetHeight;
  19. width = document.body.offsetWidth;
  20. }
  21.  
  22. //alert("height="+height+" width="+width);
  23. td_left = document.getElementById("td_left");
  24. td_left.style.width = (width/2)+"px";
  25. td_left.style.height = (height/2)+"px";
  26. }
  27. </head>
  28. <body onload='set_res();' onresize='set_res();'>
  29. <table border='1'>
  30. <tr>
  31. <td id='td_left'>test1</td>
  32. <td id='td_right'>test2</td>
  33. </tr>
  34. </tbody>
  35. </body>
  36. </html>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 01:33