Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Plik style.css
- .przycisk
- {
- display:block;
- position:absolute;
- height:30px;
- background-color:green;
- line-height:30px;
- text-align:center;
- font-family:Arial;
- font-size:17px;
- color:white;
- font-weight:bold;
- border:3px solid silver;
- letter-spacing:4px;
- cursor:default;
- }
- .przycisk:active
- {
- border:1px solid silver;
- }
- Plik klasa.php
- <?php
- class Przyciski
- {
- public $pozycja_x='20';
- public $pozycja_y='20';
- public $szerokosc='200';
- public $napis='Przycisk';
- public $kolor='green';
- public $adres='http://www.teacher.webd.pl';
- public function wyswietl()
- {
- echo '<a href="'.$this->adres.'" style="text-decoration:none;">'."\n";
- echo '<div class="przycisk" style="left:'.$this->pozycja_x.'px;top:'
- .$this->pozycja_y.'px;width:'.$this->szerokosc.'px;background-color:'
- .$this->kolor.';">'."\n";
- echo $this->napis."\n";
- echo '</div>'."\n";
- echo '</a>';
- }
- }
- ?>
- Plik przyciski.php
- <!doctype html>
- <html>
- <head>
- <title>Przyciski</title>
- <meta charset="utf-8" />
- <link rel="stylesheet" type="text/css" href="style.css" />
- </head>
- <body>
- <?php
- require_once('klasa.php');
- $przycisk1=new Przyciski();
- $przycisk1->napis='Odsyłacz do strony autora';
- $przycisk1->szerokosc='400';
- $przycisk1->wyswietl();
- $przycisk2=new Przyciski();
- $przycisk2->pozycja_y='60';
- $przycisk2->napis='Odsyłacz do strony szkoły';
- $przycisk2->adres='http://glowacki.p9.pl';
- $przycisk2->szerokosc='400';
- $przycisk2->kolor='red';
- $przycisk2->wyswietl();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement