Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="it">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <style>
- .cuore {
- position:relative;
- width:50px;
- height:40px;
- -moz-transform:rotate(0);
- -webkit-transform:rotate(0);
- -ms-transform:rotate(0);
- -o-transform:rotate(0);
- transform:rotate(0);
- display: none;
- }
- .cuore:before {
- content:"";
- width:20px;
- height:30px;
- position:absolute;
- top:0;
- left:18px;
- background:red;
- border-radius:60px 60px 0 0;
- -moz-transform:rotate(-45deg);
- -webkit-transform:rotate(-45deg);
- -ms-transform:rotate(-45deg);
- -o-transform:rotate(-45deg);
- transform:rotate(-45deg);
- -moz-transform-origin:0 100%;
- -webkit-transform-origin:0 100%;
- -ms-transform-origin:0 100%;
- -o-transform-origin:0 100%;
- transform-origin:0 100%;
- }
- .cuore:after {
- content:"";
- width:20px;
- height:30px;
- position:absolute;
- left:0;
- top:0;
- background:red;
- border-radius:60px 60px 0 0;
- -moz-transform:rotate(45deg);
- -webkit-transform:rotate(45deg);
- -ms-transform:rotate(45deg);
- -o-transform:rotate(45deg);
- transform:rotate(45deg);
- -moz-transform-origin:100% 100%;
- -webkit-transform-origin:100% 100%;
- -ms-transform-origin:100% 100%;
- -o-transform-origin:100% 100%;
- transform-origin:100% 100%;
- }
- .iscrizione{
- background-color: lightgray;
- padding: 10px;
- font-weight: bold;
- color: black;
- border-radius: 5px;
- display: inline-block;
- cursor: pointer;
- }
- </style>
- <title>YouTube</title>
- </head>
- <body>
- <img src="img/londra1.jpg" alt=""><br>
- <script>
- const coloreBase ="black";
- const colori = ["red", "orange", "blue", "green", "purple", "yellow"];
- const img = document.querySelector("img");
- img.style.borderColor=coloreBase;
- img.style.borderStyle="solid";
- img.style.borderWidth="3px";
- let cont=0;
- img.addEventListener("mouseenter", function () {
- this.style.borderColor = colori[cont];
- cont++;
- if (cont===6) cont=0;
- });
- img.addEventListener("mouseleave", function () {
- this.style.borderColor = coloreBase;
- })
- </script>
- </body>
- </html>
- *********************************************************************************************************
- *********************************************************************************************************
- <!DOCTYPE html>
- <html lang="it">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <style>p{font-size: 18px;}</style>
- <title>Document</title>
- </head>
- <body>
- <p>
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptate eum blanditiis labore obcaecati nostrum, et minima quisquam ipsa sunt pariatur maiores nulla. Facere quos non, sequi mollitia voluptatem consectetur doloremque.
- Earum, aliquid? Necessitatibus odio nemo perferendis accusantium porro? Rerum debitis dignissimos tempora enim sint soluta. Aliquid obcaecati, quos sunt pariatur iure adipisci aut nobis? Voluptatem beatae optio dolore nemo minus.
- Vel repudiandae, nobis saepe corporis officia nemo impedit eligendi natus inventore ullam dolor dicta voluptate alias veritatis corrupti earum, dignissimos odio molestiae ad, quos similique quas tempore molestias? Illo, unde!
- Repellat animi voluptates voluptatem omnis dolore eligendi tenetur tempore? Facilis suscipit nulla pariatur in! Dolor, sed blanditiis. Assumenda optio consequatur debitis esse quaerat, eius ipsa accusantium nam cupiditate repudiandae aperiam.
- Odio incidunt corporis, culpa sapiente, magni rem velit quos corrupti laudantium repudiandae cumque dignissimos ducimus eum repellendus? Rerum ipsam officiis facere nulla magnam quidem? Mollitia quidem maxime excepturi rerum nulla.
- </p>
- <input type="number" id="dimensione" min="15" max="25" value="18"><br>
- <button>Applica</button>
- <script>
- document.querySelector("button").addEventListener("click", function () {
- const nuovaDimensione = parseInt(document.getElementById("dimensione").value);
- const p = document.querySelector("p");
- if (isNaN(nuovaDimensione))
- alert("non hai inserito un numero");
- else
- if (nuovaDimensione<15 || nuovaDimensione>25)
- alert("Numero fuori intervallo consentito");
- else
- p.style.fontSize = nuovaDimensione+"px";
- p.value="18";
- })
- </script>
- </body>
- </html>
- *********************************************************************************************************
- *********************************************************************************************************
- <!DOCTYPE html>
- <html lang="it">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Lampada</title>
- <style>
- .stelo,.base{
- background-color: #000;
- }
- .base{
- width: 160px;
- height: 20px;
- margin: 0 20px;
- }
- .stelo{
- width: 20px;
- height: 100px;
- margin-left: 90px ;
- }
- .lampada{
- width:100px;
- height:0;
- border-bottom: 200px solid black;
- border-left: 50px solid transparent;
- border-right: 50px solid transparent;
- }
- .interruttore{
- height: 100px;
- width: 50px;
- font-size: 50px;
- color: #FFF;
- background-color: #000;
- text-align: center;
- padding: 20px 0;
- box-sizing: border-box;
- margin-top: 50px;
- }
- .interruttore:hover{
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <div class="lampada"> </div>
- <div class="stelo"> </div>
- <div class="base"> </div>
- <div class="interruttore">0</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement