Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <style>
- .tlo{
- position: relative;
- width: 400px;
- height: 300px;
- border: 2px solid black;
- border-radius: 5px;
- }
- .napis{
- position: absolute;
- top: 2px;
- left: 70px;
- text-align: center;
- font-size: 50px;
- }
- .zmien{
- position: absolute;
- top: 250px;
- left: 165px;
- border: 1px solid black;
- }
- </style>
- </head>
- <body>
- <pre>
- <script>
- function klik(){
- r=Math.floor(Math.random()*256)
- g=Math.floor(Math.random()*256)
- b=Math.floor(Math.random()*256)
- s=Math.floor(Math.random()*50)+10
- var p=document.getElementById("inapis")
- var att=document.createAttribute("style")
- att.value="color: rgb("+r+", "+g+", "+b+"); font-size: "+s+";"
- p.setAttributeNode(att)
- }
- </script>
- </pre>
- <form name="formularz">
- <div class="tlo">
- <p id="inapis" class="napis">NAPIS Z <br>LOSOWYM<br> STYLEM</p>
- <input type="button" value="ZMIEŃ" class="zmien" onClick="klik()"/>
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement