Advertisement
Guest User

HTML example code 1

a guest
Nov 3rd, 2015
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.99 KB | None | 0 0
  1.  
  2.       <!--
  3.         To load an image from the web, you can use the <img />
  4.         tag, with the attributes src that contain a link to the image.
  5.  
  6.         Other attributes such as title can be used to give the user a text popup if the user mouse over the image.
  7.  
  8.         The alt attribute is use if you want some text to be display if the image can not be load.
  9.        
  10.         The height attribute can be used to set the hight of the image, to resize the image, the unit that can be used are px, em, and %,
  11.  
  12.         An image dose not need to be a pair tag, as it dose not have any infomation between the tag but it is all in the attribues.
  13.  
  14.      -->
  15.       <img src="http://www.google.co.uk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
  16.          style="width:10%;"
  17.          title="this is the google logo"
  18.          alt="This is supose to show the google logo"/>
  19.      
  20.       <br>
  21.       <br>
  22.       <br>
  23.  
  24.       <!--
  25.         To link to a web page you can use the <a> tag, also called the anchor tag.
  26.  
  27.         The attribute href is the url where you want the user to end up, so to link to google, you put href="www.google.com".
  28.  
  29.         The title attribue show the user a text box if they mouse over it.
  30.  
  31.         The target attribute tell the browers how to behaive if the user click the link,
  32.         see the table below for the dffrent values and what they do.
  33.  
  34.         Target Value    Description
  35.         _blank           Opens the linked document in a new window or tab
  36.         _self           Opens the linked document in the same frame as it was clicked     (this is default)
  37.         _parent        Opens the linked document in the parent frame
  38.         _top            Opens the linked document in the full body of the window
  39.         framename        Opens the linked document in a named frame
  40.  
  41.      -->
  42.       <a href="https://www.google.com"
  43.         title="Link to google"
  44.         target=""> Google.com </a>
  45.       <br>
  46.       <br>
  47.       <br>
  48.  
  49.       <p>
  50.           <!--
  51.              If you want an image to be a link you simply "wrap" the <img> tag with <a> tag
  52.              with the attributes you have set, as it seen below
  53.           -->
  54.           <a href="https://www.google.com"
  55.              title="link to google.com">
  56.               <img src="http://www.google.co.uk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
  57.                   style="width:10%;"
  58.                   title="this is the google logo"
  59.                   alt="This is supose to show the google logo"/>
  60.           </a>
  61.        </p>
  62.      
  63.       <br>
  64.       <br>
  65.       <br>
  66.  
  67.       <!--
  68.         The attribue "style" can a list of pairs that are sepirated with a ;
  69.         The pairs use CSS, with is always in pairs of two, name:value.
  70.         Below is a list of comment css pairs you can input
  71.  
  72.         Name                decription                  sample values
  73.         background-color    Set the background color    red, black, green, etc
  74.                             of the element
  75.         color               Set the color of the text   red, black, whith, etc
  76.         font-family         Set the font family         verdana, courier
  77.         font-size           Set the size of the font,   100%, 50%, 25.5%, etc
  78.                            it is set in %
  79.         text-align          how to align the text       center, right, left
  80.         height              The height of the element   100%, 50%, 250px, 1000px, etc
  81.                             Value offent set in px or %
  82.         width               The with of the element     100%, 50%, 250px, 1000px, etc
  83.                             Value offent set in px or %
  84.       -->
  85.       <h3 style="text-align:center">This head line is in the center</h3>
  86.      
  87.       <p style="background-color:black;
  88.                 color:white;text-align:center;">
  89.         This is the first element that has a style to it
  90.         <br>
  91.  
  92.         <b style="background-color:red;
  93.                   color:blue;">
  94.             This is the second element that has a style to it
  95.         </b>
  96.         <br>
  97.         This is the third element that has a style to it
  98.       </p>
  99.  
  100.     <!--
  101.         This is the end of the first example
  102.      -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement