Tuesday, March 4, 2014

Cascading Style Sheets

CSS is the acronym for “Cascading Style Sheets”. CSS is an extension to basic HTML that allows you to style your web pages.
An example of a style change would be to make words bold. In standard HTML you would use the <b> tag like so:

<b>bold text</b>

This works fine and there is nothing wrong with it by itself, except that now if you wanted to say change all your text that you initially made bold to underlined, you would have to go to every spot in the page and change the tag.
Another disadvantage can be found in this example: say you wanted to make the above text bold, make the font style Arial and change its color to red; you would need a lot of code wrapped around the text.  For example:

<font color="#FF0000" face="Arial"><strong>BLABLABLA</strong></font>

This is lengthy and contributes to making your HTML messy. With CSS, you can create a custom style elsewhere and set all its properties, give it a unique name and then ‘tag’ your HTML to apply these stylistic properties:

<p class="style1">CSS Style</p>

And in between the tags at the top of your web page you would insert this CSS code that defines the style we just applied:

<style type="text/css">
.style1
{
font-family: Arial;
font-weight: bold;
color: #FF0000;
}
</style>

In the above example we embed the CSS code directly into the page itself. This is fine for smaller projects or in situations where the styles you’re defining will only be used in a single page. There are many times when you will be applying your styles to many pages and it would be a hassle to have to copy and paste your CSS code into each page.
Besides the fact that you will be cluttering up your pages with the same CSS code, you also find yourself having to edit each of these pages if you want to make a style change. Like with JavaScript, you can define/create your CSS styles in a separate file and then link it to the page you want to apply the code to:

<link href="blabla.css" rel="stylesheet"  type="text/css">


The above line of code links your external style sheet called “blabla.css” to the HTML document. You place this code in between the <head> </head> tags in your web page.
In making a webpage, time is crucial.  Therefore, CSS is very helpful in terms of saving precious time and having an orderly webpage.

The DIV Attribute

         The div attribute is a generic block-level element. It doesn’t convey any meaning about its contents (unlike a p element that signifies a paragraph, or an h1 or h2 element that would indicate a level 1 or level 2 heading, respectively); as such, it’s easy to customize it to your needs. The div element is currently the most common method for identifying the structural sections of a document and for laying out a web page using CSS.
         Some developers perceive similarities between the p and the div elements, seeing them as being interchangeable, but this isn’t the case. The p element offers more semantic information (“this is a paragraph of text, a small collection of thoughts that are grouped together; the next paragraph outlines some different thoughts”), while the div element can be used to group almost any elements together. Indeed, it can contain almost any other element, unlike p, which can only contain inline elements.
Example:
The HTML below shows two divs being used in conjunction with id attributes to identify different sections of a web page:
<html>
<body>
<div style=“width: 100%; height: 20%; background-color: #e34c97”>
<h1>This is the heading</h1>
</div>
<div style=“width: 100%; height: 70%; background-color: #98cd89”>
<h4>This is the main content</h4>
</div>
<div style=“width: 100%; height: 10%; background-color: #870bc4”>
<small>This is the footer</small>
</div>
</body>

</html>

Adding HTML Images, Tables, and Hyperlinks

HTML Images - The <img> Tag, the Src, and the Alt Attribute
In HTML, images are defined with the <img> tag.  The <img> tag is empty, which means that it contains attributes only, and has no closing tag.  To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src attribute is the URL of the image you want to display.
Example:
<img src="blabla.jpg" alt="error">
(Hello there! This picture was inserted using the <img> tag)
The required alt attribute specifies an alternate text for an image, if the image cannot be displayed.  The example given above has an alt attribute showing that if the image can’t be displayed, a text “error” is displayed.  The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection or an error in the src attribute).

HTML Images – How to Set Height and Width of an Image
The height and width attributes are used to specify the height and width of an image. 
Example:
<img src="blabla.jpg" alt="error" width="800" height="600">

            Changing the width and the height attributes can make the image bigger or smaller according to the size of the image.  By the way, the height and width is measured in pixels.  

HTML Hyperlinks
          The HTML <a> tag defines a hyperlink.  A hyperlink (or link) is a word, group of words, or image that you can click on to jump to another document.  When you move the cursor over a link in a Web page, the arrow will turn into a little hand.  The most important attribute of the <a> element is the href attribute, which indicates the link's destination.  Between the start and the end tags is the text shown in the web site. . 

Example:
<a href=“http://www.google.com”>Google</a>

By default, links will appear as follows in all browsers:
  • An unvisited link is underlined and blue
  • A visited link is underlined and purple
  • An active link is underlined and red

Monday, March 3, 2014

HTML Formatting Tags

        The following HTML tags are used to format the appearance of the text on your web page. This can brighten up the look of the web page, however, too much variety in the text formatting can also look displeasing.  Example are:
Header - <h1> </h1>
There are 6 levels of headings available, from h1 for the largest and most important heading, down to h6 for the smallest heading.
Bold - <b> </b>
The text in between the tags will be bold, and stand out against text around it, the same as in a word processor.
Italic - <i> </i>
Also working the same way as a word processor, italics displays the text at a slight angle.
Underline - <u> </u>
Again, the same as underline in a word processor. Note that html links are already underlined and don't need the extra tag.
Strike-out - <strike> </strike>
Puts a line right through the centre of the text, crossing it out. Often used to show that text is old and no longer relevant. Also works by using <s> </s> instead.
Preformatted Text - <pre> </pre>
Any text between the pre tags, including spaces, carriage returns and punctuation, will appear in the browser as it would in a text editor (normally browsers ignore multiple spaces)
Source Code - <code> </code>
Similar to tt the text is displayed in a fixed-width font, and is commonly used to show source code. I have used it on this site, along with stylesheets, to show all tags.
Typewriter Text - <tt> </tt>
The text appears to have been typed by a typewriter, in a fixed-width font. For example: This text is written using the <tt></tt> tags.
Block Quote - <blockquote> </blockquote>
Defines a long quotation, and the quote is displayed with an extra wide margin on the left hand side of the block quote.
Small - <small> </small>
Instead of having to set a font size, you can use the small tag to render text slightly smaller than the text around it. Useful for displaying the 'fine-print'.
Font Color - <font color="color_name/hex_number_/rgb_number"> </font>
Change the colour of a few words or a section of text. The 6 question marks represent the hex color code.

                                                         Attribute Values
Value
Description
color_name
Specifies the text color with a color name (like "red")
hex_number
Specifies the text color with a hex code (like "#ff0000")
rgb_number
Specifies the text color with an rgb code (like "rgb(255,0,0)")

Font Size - <font size="5"> </font>
For an immediate change of font size with respect to the font size preceding it, this tag increase or decreases the size of the font by the number you specify. 
Change Font Face - <font face="Arial"> </font>
To show text in a particular font, use the font name such "Helvetica" or "Arial" or "Courier". Be aware that using some fancy font from your computer means that the person viewing that page must also have that font installed on their computer too, otherwise it will look totally different to them. 
Centre - <center> </center>
A useful tag, as it says, it makes everything in between the tags centred (in the middle of the page).
Emphasis - <em> </em>
Used to emphasize text, which usually appears in italics, but can vary according to your browser.
Strong Emphasis - <strong> </strong>
Used to emphasize text more, which usually appears in bold, but can vary according to your browser.

Hyper Text Markup Language

         HTML or HyperText Markup Language is the main markup language for creating web pages and other information that can be displayed in a web browser.
             HTML is written in the form of HTML elements consisting of tags enclosed in angle brackets (like <html>), within the web page content. HTML tags most commonly come in pairs like <h1>and </h1>, although some tags represent empty elements and so are unpaired, for example <img>. The first tag in a pair is the start tag, and the second tag is the end tag (they are also called opening tags and closing tags). In between these tags web designers can add text, further tags, comments and other types of text-based content.
           The purpose of a web browser is to read HTML documents and compose them into visible or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page.
          HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts written in languages such as JavaScript which affect the behavior of HTML web pages.
               The latest version of HTML is HTML 5.  

What is HTML5?


            HTML5 is the latest standard for HTML.  The previous version of HTML, HTML 4.01, came in 1999, and the internet has changed significantly since then.  HTML5 was designed to replace both HTML 4, XHTML, and the HTML DOM Level .  It was specially designed to deliver rich content without the need for additional plugins.  The current version delivers everything from animation to graphics, music to movies, and can also be used to build complicated web applications.  HTML5 is also cross-platform.   It is designed to work whether you are using a PC, or a Tablet, a Smartphone, or a Smart TV.

How Did HTML5 Get Started?

           HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG).  WHATWG was working with web forms and applications, and W3C was working with XHTML 2.0. In 2006, they decided to cooperate and create a new version of HTML.  Some rules for HTML5 were established:

  • New features should be based on HTML, CSS, DOM, and JavaScript
  • The need for external plugins (like Flash) should be reduced
  • Error handling should be easier than in previous versions
  • Scripting has to be replaced by more markup
  • HTML5 should be device-independent
  • The development process should be visible to the public

How Web Searching Works

The Internet is over 1.99 billion pages as of March 3, 2014 (http://www.worldwidewebsize.com).  Searching the web without a search engine might be a little annoying because you would look at each website.  Imagine looking at 1.99 billion pages!  It would take you forever.  Google.com is one of the popular search engines today and I'm sure you would be curious how it works.


Saturday, March 1, 2014

Ping Pong


           Ping is a basic Internet program that allows a user to verify that a particular IP address exists and can accept requests.
               Ping is used diagnostically to ensure that a host computer the user is trying to reach is actually operating. Ping works by sending an Internet Control Message Protocol (ICMP) Echo Request to a specified interface on the network and waiting for a reply. Ping can be used for troubleshooting to test connectivity and determine response time.
           As a verb, ping means "to get the attention of" or "to check for the presence of" another party online. The computer acronym (for Packet Internet or Inter-Network Groper) was contrived to match the submariners' term for the sound of a returned sonar pulse.
               For example, the ping of http://www.google.com is 74.125.224.72