Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web Development - A really soft introduction

Web Development - A really soft introduction

Slides for workshop organized by CeSIUM @ UMINHO about web development.

Francisco Neves

November 20, 2013
Tweet

More Decks by Francisco Neves

Other Decks in Programming

Transcript

  1. <!DOCTYPE html> <html> <head> <title>My first page</title> <meta name=“author” content=“Francisco

    Neves”/> <link rel=“shortcut icon” href=“favicon.ico”/> <style> p { color: red; } </style> </head> <body> <p>This is my first page. Thank you CeSIUM!</p> </body> </html>
  2. <!DOCTYPE html> <html> <head> … </head> <body> <h1>This is header

    1</h1> <h2>This is header 2</h2> <h3>This is header 3</h3> <h4>This is header 4</h4> <h5>This is header 5</h5> <h6>This is header 6</h6> </body> </html>
  3. <!DOCTYPE html> <html> <head> … </head> <body> <p>First paragraph</p> <p>Second

    paragraph</p> <p>Third paragraph</p> </body> </html>
  4. <!DOCTYPE html> <html> <head> … </head> <body> <table> <tr> <td>First

    Column</td> <td>Second Column</td> </tr> </table> </body> </html>
  5. <!DOCTYPE html> <html> <head> … </head> <body> <form action=“page.php” method=“post”>

    <input type=“text” value=“Google Search”/> <input type=“submit” value=“Go”/> </form> </body> </html>
  6. <!DOCTYPE html> <html> <head> … </head> <body> <form action=“page.php” method=“post”>

    <input type=“file”/> <input type=“submit” value=“Go”/> </form> </body> </html>
  7. <!DOCTYPE html> <html> <head> … </head> <body> <form action=“page.php” method=“post”>

    <select name=“my_select”> <option value=“1”>Option 1</option> <option value=“2”>Option 2</option> <option value=“3”>Option 3</option> </select> </form> </body> </html>
  8. <!DOCTYPE html> <html> <head> … </head> <body> <div>This is a

    block</div> <script> alert(“I am here”); </script> </body> </html>
  9. <!DOCTYPE html> <html> <head> … </head> <body> <div>This is a

    block</div> <!-- My block --> </body> </html>
  10. <!DOCTYPE html> <html> <head> … </head> <body> <div id=“main-content”></div> <div

    id=“main-content”></div> <!-- Don’t do it! --> </body> </html>
  11. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”></div> <div

    class=“header”></div> <!-- You can do it! --> </body> </html>
  12. <!DOCTYPE html> <html> <head> … </head> <body> <div>This is a

    block</div> </body> </html> div { … }
  13. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”></div> <div

    class=“header”></div> </body> </html> .header { … }
  14. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { background-color: #a5a5a5; }
  15. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { text-transform: uppercase; }
  16. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { font-size: 40px; }
  17. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { border: 1px solid #000000 }
  18. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { color: #00a244 }
  19. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { margin: 25px }
  20. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { padding: 25px }
  21. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { display: inline-block }
  22. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { float: right }
  23. <!DOCTYPE html> <html> <head> … </head> <body> <div class=“header”>Header</div> <div

    class=“header”>Header</div> </body> </html> .header { position: absolute; top:50px }
  24. <?php $name = ‘Francisco Neves’; $var = “Hello $name”; //

    $var = ‘Hello ’ . $name; has same output! echo $var; ?>
  25. <?php $var = ‘I am a string’; if( $var ==

    ‘I am a string’ ) { echo ‘the same!’; } else { echo ‘bye’; } ?>
  26. <?php $var = 3; while( $var > 0 ) {

    echo $var . ‘ ‘; $var--; } ?>
  27. <?php for( $var = 3; $var > 0; $var++ )

    { echo $var . ‘ ‘; } ?>
  28. <?php $var = 3; switch( $var ) { case 1:

    echo ‘a’; break; case 2: echo ‘b’; break; case 3: echo ‘c’; break; default: echo 404; } ?>
  29. <?php function even( $var ) { if( $var % 2

    == 0 ) return true; else return false; } var_dump( even( 6 ) ); ?>
  30. <?php $var = ‘Francisco Neves’; ?> <!DOCTYPE html> <html> <head>

    … </head> <body> <div>Hello <?php echo $var; ?></div> </body> </html>
  31. <!DOCTYPE html> <html> <head> … </head> <body> <form action=“page.php” method=“post”>

    <input type=“text” name=“my_text”/> … <input type=“submit” name=“my_submit”/> </form> </body> </html>