Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. Plik style.css
  2.  
  3. .przycisk
  4. {
  5. display:block;
  6. position:absolute;
  7. height:30px;
  8. background-color:green;
  9. line-height:30px;
  10. text-align:center;
  11. font-family:Arial;
  12. font-size:17px;
  13. color:white;
  14. font-weight:bold;
  15. border:3px solid silver;
  16. letter-spacing:4px;
  17. cursor:default;
  18. }
  19.  
  20. .przycisk:active
  21. {
  22. border:1px solid silver;
  23. }
  24. Plik klasa.php
  25.  
  26. <?php
  27. class Przyciski
  28. {
  29. public $pozycja_x='20';
  30. public $pozycja_y='20';
  31. public $szerokosc='200';
  32. public $napis='Przycisk';
  33. public $kolor='green';
  34. public $adres='http://www.teacher.webd.pl';
  35.  
  36. public function wyswietl()
  37. {
  38. echo '<a href="'.$this->adres.'" style="text-decoration:none;">'."\n";
  39. echo '<div class="przycisk" style="left:'.$this->pozycja_x.'px;top:'
  40. .$this->pozycja_y.'px;width:'.$this->szerokosc.'px;background-color:'
  41. .$this->kolor.';">'."\n";
  42. echo $this->napis."\n";
  43. echo '</div>'."\n";
  44. echo '</a>';
  45. }
  46. }
  47. ?>
  48. Plik przyciski.php
  49.  
  50. <!doctype html>
  51. <html>
  52. <head>
  53. <title>Przyciski</title>
  54. <meta charset="utf-8" />
  55. <link rel="stylesheet" type="text/css" href="style.css" />
  56. </head>
  57. <body>
  58. <?php
  59. require_once('klasa.php');
  60.  
  61. $przycisk1=new Przyciski();
  62. $przycisk1->napis='Odsyłacz do strony autora';
  63. $przycisk1->szerokosc='400';
  64. $przycisk1->wyswietl();
  65.  
  66. $przycisk2=new Przyciski();
  67. $przycisk2->pozycja_y='60';
  68. $przycisk2->napis='Odsyłacz do strony szkoły';
  69. $przycisk2->adres='http://glowacki.p9.pl';
  70. $przycisk2->szerokosc='400';
  71. $przycisk2->kolor='red';
  72. $przycisk2->wyswietl();
  73. ?>
  74. </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement