Advertisement
blackpab

HTML_Example

Apr 10th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 13.06 KB | None | 0 0
  1. ============================= z1 =========================================
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <style>
  6. p.intro {
  7.     background-color:black;
  8.     color:white;
  9.     border:1px solid grey;
  10.     padding:10px;
  11.     margin:30px;
  12.     font-size:150%;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17.  
  18. <h1>To jest nagłówek</h1>
  19.  
  20. <p class="intro">To jest akapit.</p>
  21. <p class="intro">To jest akapit.</p>
  22. <p class="intro">To jest akapit.</p>
  23.  
  24. </body>
  25. </html>
  26.  
  27. ============================= z2 =========================================
  28. <!DOCTYPE html>
  29. <html>
  30. <head>
  31. <style>
  32. body {background-color:lightgrey;}
  33. h1   {color:blue;}
  34. p {
  35.     color:black;
  36.     /* -- */
  37.     border-style: solid;
  38.     border-color: red;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43.  
  44. <h1>To jest nagłówek</h1>
  45.  
  46. <p>To jest akapit.</p>
  47. <p>To jest akapit.</p>
  48. <p>To jest akapit.</p>
  49. <p>To jest akapit.</p>
  50.  
  51. </body>
  52. </html>
  53.  
  54. ============================= z3 =========================================
  55. <!DOCTYPE html>
  56. <html>
  57.     <head>
  58.  
  59.         <style>
  60.         /* -- */
  61.         body {text-align: center;}     
  62.         </style>
  63.     </head>
  64.     <body>
  65.         <h1>To jest nagłówek</h1>
  66.         <h2>TO też jest nagłówek</h2>
  67.         <p>To jest akapit</p>
  68.         <p>To też jest akapit</p>
  69.     </body>
  70. </html>
  71.  
  72. ============================= z4 =========================================
  73. <!DOCTYPE html>
  74. <html>
  75. <head>
  76. <style>
  77.     /* -- */
  78.     #special {
  79.         color: red;
  80.     }
  81. </style>
  82. </head>
  83. <body>
  84.  
  85. <h1>Mój <span id="special">Unikalny</span> Nagłówek</h1>
  86.  
  87. </body>
  88. </html>
  89.  
  90. ============================= z5 =========================================
  91. <!DOCTYPE html>
  92. <html>
  93. <head>
  94. <style>
  95. ul#menu {
  96.     list-style-type: none;
  97.     margin: 0;
  98.     padding: 0;
  99. }
  100.  
  101. ul#menu li {
  102.     float:left;
  103.     /* -- */
  104.     padding-right: 5px;
  105. }
  106. </style>
  107. </head>
  108. <body>
  109.  
  110. <ul id="menu">
  111.   <li>Jabłka</li>
  112.   <li>Banany</li>
  113.   <li>Cytryny</li>
  114.   <li>Pomarańcze</li>
  115. </ul>  
  116.  
  117. </body>
  118. </html>
  119.  
  120. ============================= z6 =========================================
  121. <!DOCTYPE html>
  122. <html>
  123. <head>
  124. <body>
  125.  
  126. <ol type="a">
  127.   <li>Kawa</li>
  128.   <li>Herbata</li>
  129.   <li>Mleko</li>
  130. </ol>
  131.  
  132. </body>
  133. </html>
  134.  
  135. ============================= z7 =========================================
  136. <!DOCTYPE html>
  137. <html>
  138. <head>
  139. <style>
  140. table, th, td {
  141.     border: 1px solid black;
  142.     text-align: left;
  143. }
  144.  
  145. /* -- */
  146. th, td {
  147.       background: black;
  148.       color: white;  
  149. }
  150. </style>
  151. </head>
  152. <body>
  153.  
  154. <table style="width:100%">
  155.   <tr>
  156.     <th>Imię</th>
  157.     <th>Nazwisko</th>
  158.     <th>Punkty</th>
  159.   </tr>
  160.   <tr>
  161.     <td>John</td>
  162.     <td>Smith</td>
  163.     <td>50</td>
  164.   </tr>
  165.   <tr>
  166.     <td>Ewa</td>
  167.     <td>Jackson</td>
  168.     <td>94</td>
  169.   </tr>
  170. </table>
  171.  
  172. </body>
  173. </html>
  174.  
  175. ============================= z8 =========================================
  176. <!DOCTYPE html>
  177. <html>
  178. <body>
  179.  
  180. <form action="action_page.php" method="post">
  181. Imię: <input type="text" name="name">
  182.  
  183. <!-- -->
  184. <input type="submit" name="send" value="wyslij">
  185.  
  186. </form>
  187.  
  188. </body>
  189. </html>
  190.  
  191. ============================= z9 =========================================
  192.  
  193. <!DOCTYPE html>
  194. <html>
  195. <body>
  196.  
  197. <form action="/action_page.php">
  198.   Ilość (pomiędzy 1 a 5):
  199.   <!-- -->
  200.   <input type="number" name="numer" min="1" max="5">
  201.   <input type="submit">
  202. </form>
  203.  
  204. </body>
  205. </html>
  206.  
  207. ============================= z10 =========================================
  208. <!DOCTYPE html>
  209. <html>
  210. <head>
  211. <style>
  212. p {
  213.     background-color: lightblue;
  214.     /* -- */
  215.     padding: 25px 50px 25px 50px;
  216. }
  217. </style>
  218. </head>
  219. <body>
  220.  
  221. <h1>To jest nagłówek</h1>
  222. <p>To jest akapit. To jest akapit. To jest akapit. To jest akapit.</p>
  223.  
  224. </body>
  225. </html>
  226.  
  227. ============================= z11 =========================================
  228. <!DOCTYPE html>
  229. <html>
  230. <head>
  231. <style>
  232. .container {
  233.     position: relative;
  234. }
  235.  
  236. .topleft {
  237.     font-size: 18px;
  238.     /* -- */
  239.     position: absolute;
  240.     margin-left: 30px;
  241.     margin-top: 15px;
  242. }
  243.  
  244. img {
  245.     width: 100%;
  246.     height: auto;
  247.     opacity: 0.3;
  248. }
  249. </style>
  250. </head>
  251. <body>
  252.  
  253. <div class="container">
  254.   <img src="trolltunga.jpg" alt="Norway" width="1000" height="300">
  255.   <div class="topleft">Top Left</div>
  256. </div>
  257.  
  258. </body>
  259. </html>
  260.  
  261.  
  262. ============================= z12 =========================================
  263. <!DOCTYPE html>
  264. <html>
  265. <head>
  266. <style>
  267. img {
  268.     position: absolute;
  269.     left: 0px;
  270.     top: 0px;
  271.     /* -- */
  272.     z-index: -1;
  273. }
  274. </style>
  275. </head>
  276. <body>
  277.  
  278. <h1>This is a Heading</h1>
  279. <p>This is a paragraph.</p>
  280. <p>This is another paragraph.</p>
  281. <img src="trolltunga.jpg" alt="Norway" width="1000" height="300">
  282.  
  283. </body>
  284. </html>
  285.  
  286. ============================= z13 =========================================
  287. <!DOCTYPE html>
  288. <html>
  289. <head>
  290. <style>
  291. /* -- */
  292.  input:hover{
  293.     background: lightblue;
  294.  }
  295.  
  296. </style>
  297. </head>
  298. <body>
  299.  
  300. <form action="/action_page.php" method="get">
  301.   Imię: <input type="text" name="fname"><br>
  302.   Nazwisko: <input type="text" name="lname"><br>
  303.   <input type="submit" value="Wyślij">
  304. </form>
  305.  
  306. </body>
  307. </html>
  308.  
  309. ============================= z14 =========================================
  310. <!DOCTYPE html>
  311. <html>
  312. <head>
  313. <style>
  314. /* -- */
  315.  p::first-line{
  316.     color: red;
  317.  }
  318. </style>
  319. </head>
  320. <body>
  321.  
  322. <p>In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. 'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'</p>
  323.  
  324. </body>
  325. </html>
  326.  
  327. ============================= z15 =========================================
  328. <!DOCTYPE html>
  329. <html>
  330. <head>
  331. <style>
  332. img {
  333.     opacity: 0.4;
  334. }
  335. /* -- */
  336. img:hover {
  337.     opacity: 1;
  338. }
  339. </style>
  340. </head>
  341. <body>
  342.  
  343. <img src="klematis.jpg" width="150" height="113">
  344.  
  345. </body>
  346. </html>
  347.  
  348. ============================= z16 =========================================
  349. <!DOCTYPE html>
  350. <html>
  351. <head>
  352.    
  353. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  354.  
  355. </head>
  356. <body>
  357.  
  358. <h2 class="test">To jest nagłówek</h2>
  359.  
  360. <p class="test">To jest akapit  .</p>
  361. <p>To jest kolejny akapit.</p>
  362.  
  363. <button class="prz">Kliknij</button>
  364.  
  365.  
  366. <script type="text/javascript">
  367.     $("button").click(function(){
  368.         $(".test").toggle();
  369.     });
  370. </script>
  371.  
  372. </body>
  373. </html>
  374.  
  375. ============================= z17 =========================================
  376. <!DOCTYPE html>
  377. <html>
  378. <head>
  379. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  380. </head>
  381. <body>
  382.  
  383. <h2>To jest nagłówek</h2>
  384.  
  385. <p style="background-color:#ff0000">To jest akapit.</p>
  386. <p style="background-color:#00ff00">To jest akapit.</p>
  387. <p style="background-color:#0000ff">To jest akapit.</p>
  388.  
  389. <p>This is a paragraph.</p>
  390.  
  391. <button>Ustaw background-color elementów p</button>
  392.  
  393. <script type="text/javascript">
  394.     $(document).ready(function(){  
  395.             $("button").click(function() {
  396.             $("p").css("background-color", "yellow");            
  397.         });      
  398.     });
  399.  
  400. </script>
  401. </body>
  402. </html>
  403.  
  404. ============================= z18 =========================================
  405. <!DOCTYPE html>
  406. <html>
  407. <head>
  408. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  409. </head>
  410. <body>
  411.  
  412. <h1>Witaj na tej stronie</h1>
  413.  
  414. <p>To jest akapit.</p>
  415.  
  416. <div style="border: 1px solid black;">
  417.   <p>Akapit w elemencie div.</p>
  418.   <p>Kolejny akapit w elemencie div.</p>
  419. </div>
  420. <br>
  421.  
  422. <div style="border: 1px solid black;">
  423.   <p>Akapit w elemencie div.</p>
  424.   <p>Kolejny akapit w elemencie div.</p>
  425. </div>
  426. <br>
  427.  
  428. <div style="border: 1px solid black;">
  429.   <p>Akapit w elemencie div.</p>
  430.   <p>Kolejny akapit w elemencie div.</p>
  431. </div>
  432.  
  433. <script>
  434.     $(document).ready(function(){
  435.         $("div").first().css("background-color", "yellow");
  436.     });
  437. </script>
  438. </body>
  439. </html>
  440.  
  441. ============================= z19 =========================================
  442. <!DOCTYPE html>
  443. <html>
  444. <head>
  445.  
  446. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  447. <style>
  448. .important {
  449.     font-weight: bold;
  450.     font-size: xx-large;
  451. }
  452.  
  453. .blue {
  454.     color: blue;
  455. }
  456. </style>
  457. </head>
  458. <body>
  459.  
  460. <div id="div1">To jest jakiś tekst.</div>
  461. <div id="div2">To jest jakiś tekst.</div>
  462. <br>
  463.  
  464. <button>Dodaj klasy do pierwszego elementu div</button>
  465.  
  466. <script type="text/javascript">
  467.     $(document).ready(function(){
  468.         $("button").click(function(){
  469.             $("#div1").addClass("important blue");
  470.         });
  471.     });
  472.    
  473. </script>
  474. </body>
  475. </html>
  476.  
  477. ============================= z20 =========================================
  478. <!DOCTYPE html>
  479. <html>
  480. <head>
  481.  
  482. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  483. </head>
  484. <body>
  485.  
  486. <div id="div1" style="height:100px;width:300px;border:1px solid black;background-color:yellow;">
  487.  
  488. To jest tekst w elemencie div.
  489. <p>To jest akapit w elemencie div.</p>
  490. <p>To jest kolejny akapit w elemencie div.</p>
  491.  
  492. </div>
  493. <br>
  494.  
  495. <button>Wyczyść element div</button>
  496.  
  497. <script type="text/javascript">
  498.     $(document).ready(function(){
  499.         $("button").click(function(){
  500.             $("#div1").empty();
  501.         });
  502.     });
  503.  
  504. </script>
  505. </body>
  506. </html>
  507.  
  508. ============================= z21 =========================================
  509. <!DOCTYPE html>
  510. <html lang="en">
  511.   <head>
  512.     <meta charset="utf-8">
  513.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  514.     <meta name="viewport" content="width=device-width, initial-scale=1">
  515.     <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  516.     <title>Bootstrap</title>
  517.     <!-- Bootstrap -->
  518.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  519.  
  520.     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  521.     <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  522.     <!--[if lt IE 9]>
  523.      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  524.      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  525.    <![endif]-->
  526.   </head>
  527.   <body>
  528.     <div class="container-fluid">
  529.         <div class="row">
  530.             <div class="col-lg-3 col-md-4 col-sm-6">
  531.                 <button type="button" class="btn btn-primary">
  532.                     Primary <span class="badge badge-light">7</span>
  533.                 </button>
  534.                 <button type="button" class="btn btn-success">
  535.                     Success <span class="badge badge-light">3</span>
  536.                 </button>
  537.                 <button type="button" class="btn btn-danger">
  538.                     Danger <span class="badge badge-light">5</span>
  539.                 </button>
  540.             </div>
  541.             <div class="col-lg-9 col-md-8 col-sm-6">
  542.                 <img class="img-responsive" src="trolltunga.jpg" alt="Chania">
  543.             </div>
  544.         </div>
  545.     </div>
  546.  
  547.     <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  548.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  549.     <!-- Include all compiled plugins (below), or include individual files as needed -->
  550.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  551.   </body>
  552. </html>
  553. ============================= z22 =========================================
  554. <!DOCTYPE html>
  555. <html lang="en">
  556.   <head>
  557.     <meta charset="utf-8">
  558.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  559.     <meta name="viewport" content="width=device-width, initial-scale=1">
  560.     <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  561.     <title>Bootstrap</title>
  562.     <!-- Bootstrap -->
  563.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  564.  
  565.     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  566.     <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  567.     <!--[if lt IE 9]>
  568.      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  569.      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  570.    <![endif]-->
  571.   </head>
  572.   <body>
  573.         <div class="dropdown">
  574.           <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Przykład Dropdown
  575.           <span class="caret"></span></button>
  576.           <ul class="dropdown-menu">
  577.             <li><a href="#">HTML</a></li>
  578.             <li><a href="#">CSS</a></li>
  579.             <li><a href="#">JavaScript</a></li>
  580.           </ul>
  581.         </div>
  582.     <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  583.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  584.     <!-- Include all compiled plugins (below), or include individual files as needed -->
  585.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  586.   </body>
  587. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement