Exercise 13: CSS 101

CSS is an acronym for Cascading Style Sheet. This coding style is very similar to HTML, however the effects are translated differently. These CSS files define the look and layout of an HTML page. CSS define many features of the HTML such as borders, margins, fonts, sizes, etc. As this site puts it “HTML is used to structure content. CSS is used for formatting structured content”. HTML was created to simply structure text on a page, CSS developed to then format said structure. One CSS file has the power to control the structure of many files or documents. The beauty of CSS is that they can apply to many documents. Instead of writing, or copying the background colour to every single web page, you can create a single CSS file which will add the formatting to the pages you define it to. CSS files are in the format of “example.css” and can be linked to HTML pages inside the coding.

CSS works well with HTML because the coding is very similar.

HTML: <body bgcolor=”FF0000″>

CSS: body {background-color: #FF0000;>

This coding produces the same thing.

CSS coding is in the structure of

selector {property: value;}

Coding with CSS will have this shape:

body {

    background-color: #FF0000;

}

Properties will stack up below the background-color for example if more modification is required. Linking the CSS file to your HTML code is the same concept as linking a file or image to your HTML page:

<html>

 <head>

<title>My document</title>

<link rel=”stylesheet” type=”text/css” href=”style.css” />

</html>

When something needs to be formatted and it is in a group of elements, you would use the CLASS and ID system. For example, using CLASS would be to change the colour of the title for different paragraphs. If you wanted paragraph 1 and 3 to have a red title, but paragraph 2 to have a blue title, you would changes the CLASS of paragraphs 1 and 2 to red, while paragraph 2 to blue. Then all you would need to do is link the CLASS CSS formatting to the appropriate coding. This example is showing that the CLASS whitewine will change the colour of the text to a yellow-orange, where the class redwine will change the colour of the test to a dark red.

Example – HTML page:

<p>Grapes for white wine:</p>

<ul>

<li><a href=”ri.htm”>Riesling</a></li>

<li><a href=”ch.htm”>Chardonnay</a></li>

<li><a href=”pb.htm”>Pinot Blanc</a></li>

</ul>

<p>Grapes for red wine:</p>

<ul>

<li><a href=”cs.htm”>Cabernet Sauvignon</a></li>

<li><a href=”me.htm”>Merlot</a></li>

<li><a href=”pn.htm”>Pinot Noir</a></li>

</ul>

CSS File:

a {
color: blue;
}

a.whitewine {
color: #FFBB00;
}

a.redwine {
color: #800000;
}

Now, the ID system would be to change the formatting of some elements already inside other elements. Giving something an ID will give it a unique property because every ID is different.

Example – HTML:

<ol>

<li ID=”A1-1″>30</li>

<li ID=”A1-2″>50</li>

<li ID=”A1-3″>200</li>

</ol>

CSS:

#A1-1{colour:Yellow;}

#A1-2{color:red;}

#A1-3{color:Yellow;}

Differences

Examples.

External

It is ideal to use external style when editing an entire websites or multiple pages. If you have multiple styles, it could be easily changed by changing the link to the style.

Uses the <link> tag to link to the sheet style.

If you want to change the font colour of your website, instead of going to each page and changing it. Make the change in one spot and it will change the all the pages.

Internal

It is ideal for editing a single page.

Define style by using the <style> tag.

If you want to change a specific paragraph to a different font colour on that single page.

Inline

This style applies to the specific HTML element it is in.

If you want to change a specific part of the page like the font colour,size, bold, italicized etc.

The box model is essentially the borders and margins that a web page has. It consists of four different parts, margin, border, padding and content. The margin is the transparent area around the border. The border is the area around the padding and is affected by the background colour. The padding is the area around the content and is also affected by the background colour. The content is where the text, images or videos appear. The box model is what gives the web page a specific layout. For example, Youtube has a specific spacing (margins and borders) along the edges of the content as well as padding between the video, comments, and recommended videos.

Floating refers to the movement of the image. This movement refers strictly to moving the image right or left, and not up or down.

For example, {float:right} or {float:left} would be the key to floating an image so the side.

A positioning happens after you float the image, referring it where to float to.

For example, {position:absolute; right: 40px; top: 40px}

By grouping (nesting) files, you make the code simpler for yourself and for organization. In style sheets, the style is maintained throughout,

h1 { color : red ; } h1 { color : #660066 ; }

h2 { color : red ; } OR h2 { color : #660066 ; }

p { color : red ; } p { color : #660066 ; }

but by grouping them, the code becomes much simpler, and enhancing

h1, h2, p { color : red ; } OR h1, h2, p { color : #660066 ; }

Through examples, explain how to align elements.
There are different ways to align elements; one is by using floating and positioning properties to guide that element to a specific location. Another way to use the margins to be points of reference to where the element will be placed.
Example for aligning an element by using the positioning property
.right{position:absolute;right:0px;width:150px;background-color:#660066;}
Example for aligning an element by using the margins as a point of reference
.center{margin-left:auto;margin-right:auto;width:50%;background-color:#660066;}

A navigation bar is created using a list of link with <ul> and <il> elements/tags.

Firstly, open the code with <ul>.

For every link you want use this code:

<li><a hred=”example.asp”>Example</a></li>

Open and close each link with <li> and </li>

List as many links as you want, with Example being replaced by your link and your title.

Close the code with </ul>

FULL EXAMPLE:

<ul>

<li><a href=”home.asp”>Home</a></li>

<li><a href=”archives.asp”>Past Articles </a></li>

<li><a href=”search.asp”>Search </a></li>

<li><a href=”about.asp”>About</a></li>

</ul>

The code for an image gallery is a combination of other simpler codes.

You open with <html>, <head>, <style> and use your divider image that separates text from photos, and photos from photos. This file name can be called div.img

The margins, padding, border, height, float, and text align should all be applied next. Opening and closing with { , }.

Close with </style>, </head>.

Open a <body> element. (This is where you photos with go, using the specifications used above.)

An example of a code for one image would be:

<div class=”img”>

<a target=”_blank” href=”example_one.htm”>

<img src=”example_one.jpg” alt=”EXAMPLE”

width=”110” height=”90”>

</a>

<div class=”desc”>DESCRIPTION GOES HERE</div>

Use as many of those codes for however many images you have.

Close the entire code with </body> and </html>.

Sources:

“CSS Box Model”. w3schools. np.nd. 13 Nov 13. <http://www.w3schools.com/css/css_boxmodel.asp>

“CSS Group and Nesting Selectors”. w3schools. 20 Nov 13. <http://www.w3schools.com/css/css_syntax.asp>

“CSS Horizontal Align”. w3schools. 20 Nov 2013. <http://www.w3schools.com/css/css_align.asp&gt;

“Lesson 7: Identification and Grouping of Elements (class and Id).” Free Tutorials on HTML, CSS and PHP. N.p., n.d. Web. 10 Nov. 2013. <http://html.net/tutorials/css/lesson7.php>.

“Most CSS Floats Can Be Replaced With Relative And Absolute Positioning” Ben Nadel. 2 Oct, 2013. <http://www.bennadel.com/blog/2541-Most-CSS-Floats-Can-Be-Replaced-With-Relative-And-Absolute-Positioning.htm>

“Which Stylesheet Type to Use and When?” HTML Basic Tutor. np. nd.13 Nov 13. <http://www.htmlbasictutor.ca/stylesheet-type.htm>

Exercise 12: HTML 5 – 101

The difference between a website and a web page is quite simple. A website is a collection of web pages all under a similar domain. A web page is a unique page which is located on the web, under the collection of the website.

To create a web page, you will need to use HTML or HTML 5 coding. There are many elements which constitute HTML to format a web page.

Simply put, HTML is divided into two sections, the HEADER and the BODY. The HEADER consists of elements which have functions on a web page, but they are not visually displayed. Whereas the BODY contains elements of what can be seen on the web page. Coding inside of the BODY create format to the page, such examples are:

<p> creates a new paragraph

<br> breaks the link, moving elements down the page

<strong> creates bold text

To write an HTML tage, it must always have an opening tag at the beginning of the element ( <strong> ) and a closing one at the end ( </strong). There are some exceptions, such as inserting an image into a web page, this tag is singular, and does not require a closing tag. If tags did not close, the HTML reader would not be able to distinguish where an element starts or stops. A DOCTYPE tells the file reader what kind of file it is reading, an HTML file has the code HTML as it’s DOCTYPE.

The h1 tag determines Page Header titles and other significant text which will be displayed on the browser tag, and not simply on the page itself.

Having images on a webpage can be done two ways, either from a folder within the website, or linked from an external website.

Folder, the tag used would look like <img src=”image.png”>

External, the tag used would look like <img src=”http://answerguy.com/wp-content/uploads/2012/12/h1-and-influency-in-search-engine-optimization.gif“>

HTML 5 is the language makeup of the web. It is the text based language which can be read by web browsers where it translates it into the web pages we know today in Web 2.0. HTML 5 was developed alongside with the development of the internet. This coding stage allows for more complex applications and coding to be implemented into a website. Also, HTML 5 was developed to support cross-platform files.

FTP stands for File Transfer Protocol. It is used to transfer files from a local host to a web host on the internet, for example. Website developers would normally work offline on their computer, and then FTP their files onto the website host server, where they will then be read to format the website.

HTTP stands for HyperText Transfer Protocol. This is the language which web pages are read by web browsers on the internet. The browser interprets the HTML coding using HTTP to formulate the web page itself.

 

Sources:

Curee, Brian. “Webpage vs. Website; What’s the Difference?” Sonline MEDIA. N.p., n.d. Web. 7 Nov. 2013. <http://sonlinemedia.com/webpage-vs-website-whats-the-difference/>.

“File Transfer Protocol.” Wikipedia. Wikimedia Foundation, 13 Nov. 2013. Web. 7 Nov. 2013. <http://en.wikipedia.org/wiki/File_Transfer_Protocol&gt;.

“Glossary of Common Web Design Terms.” H2i Online. N.p., n.d. Web. 7 Nov. 2013. <http://www.h2ionline.com/web-design-glossary.html&gt;.

“HTML5.” Wikipedia. Wikimedia Foundation, 11 July 2013. Web. 7 Nov. 2013. <http://en.wikipedia.org/wiki/HTML5&gt;.

Lloyd, Ian. “Basic Structure of a Web Page.” HTML Elements | Learn HTML. Sitepoint, n.d. Web. 7 Nov. 2013. <http://reference.sitepoint.com/html/page-structure>.

“What Is HTTP?” Webopedia. Quinstreet Enterprise, n.d. Web. 7 Nov. 2013. <http://www.webopedia.com/TERM/H/HTTP.html&gt;.

Exercise 9: Networking 101

With Jesse Maxwell Perez, Jodie Quach, and Stanley Tsai.

A computer network is a system of communication established between machines (in this case, computers) which allow them to exchange data to each other. The connect between computers can either be wireless (internet) or via cable. The most famous computer network is the internet. When a computer is connected to another computer, or the internet, it becomes a “node”. A node is an attachment to the network where it can send, receive, forward, and perform other functions of information. One example of a node would be a router which is connected to a computer, which connects everything to the internet. The router is in charge of downloading and uploading information to and from the computer and internet. Another example of a computer network would be the connection of your computer to your printer. Some may have it set up where they share the same wifi, or USB cable.

LAN) Is a Local Area Network. It is a computer network of a small, close proximity nature. They tend to be small router with several ethernet cable ports. The LAN device can connect several computers to a shared network.

WAN) Is a Wide Area Network. It is a network which reaches a bigger scale. WANs operate on the function of smaller LAN networks. The internet, for example is a WAN computer network.

Internet) In simple terms, it is a network of networks. It is a worldwide network consisting of LANs, WANs, satellites, etc. This network supports various methods and facilities in order to download (receive) and upload (send) information from one node to another

Intranet) It is an internal computer network inside of the internet. Where it could be a school portal network which is connected to the internet. Because an intranet is define by its own protocol, it can host private websites or information accessible only to those connected to the respective intranet. It’s restrictions from being accessed globally are defined using software on the web.

MAN) Metropolitan area network. Is a computer network where the nodes interact with each other inside the same metropolitan. A MAN is generally operated by a respective local corporation inside the metropolitan.

VPN) Virtual private network. It “extends a private network across a public network”, such as the internet. It’s similar to WAN where the network can be accessed across a larger area. It also allows users to connect to a private network even if they are not in close proximity to the network itself, it can be accessed using secure protocols. They can access that private company network using the public internet network as the medium.

Peer-to-peer) It’s a network system which the computer, or nodes, communicate with each other directly using a medium such as the internet. These nodes (peers) can send and receive information to each other. The connection between peers are direct, and not centralized, where the connection is literally from computer to computer.

Server-based) It’s a similar network system which peers connect to each other using a centered node for communication. The centralization allows many nodes to connect with each other via requesting permission from the central server.

The client and server are the frameworks of the internet. Similar to their names, a server is something that provides a service to a machine. A client is the machine that requests the service. For example, the internet use a client and service infrastructure. The client is the computers where the user requests information or a service from the server. The client and server are connected by the internet and the service provided through the web.

The OSI model is a seven layer system that defines how a network transmits and receives messages within a network. The layers are organized by hierarchy from highest to lowest: application, presentation, session, transport, network, data link and physical.

  • Application contains functions such as directory services, electronic messaging, file and printer access and resource sharing.

  • Presentation is known to be the “translator” for the network as this is the layer that formats the information to be used in the application process.

  • The session layer is what enables two application processes to establish, use and terminate a connection.

  • The transport functions are simply to transport information accurately with no errors, losses or duplications. Messages are often broken down into smaller pieces of information to be transported. Once it reaches the destination, it is reassembled to the original message.

  • The network decides the path where the data should go based on the conditions, priority and other factors.

  • The data link layer transfers data  frames .It is the link  between two nodes.

  • Electrical, mechanical and functional are elements to the physical layer of the OSI model.The physical layer is responsible for  the  transmission and reception.

The five network architecture is called the Transmission Control Protocol (TCP). They include, process and application, transport, internet, network, and physical.

  • Process and application provides services to to users and programs

  • Transport provides a link between two nodes

  • The internet, also known as Network layer, is responsible for network addressing.

  • Network, also known as the Data link layer, is responsible for what the Ip will run over.

  • Physical refers to all hardware under the network layer.

Protocols → Internet protocol refers to the starting letters of the address. “http” or “https” are normally the protocol letters for the internet. The protocol will always end with “://” to signify the end of the protocol.

TCP/IP → TCP is Transmission Control Protocol and IP is Internet Protocol. TCP is the more reliable way of passing on information on email or transferring files. It connects through computers using the internet, intranet or local area network.

FTP → which stands for File Transfer Protocol. This will transfers files using the internet as its access to connect with other machines. It will remember information for accounts such as a “clear-text sign in protocol” when signing in.

HTTP → HTTP is an internet protocol, means HyperText Transfer Protocol. HTTP is the world wide fundamental communication protocol, as for a website to be seen on the world wide web, is must begin its address with “http” or “https” or it will not be able to be coded onto the internet.

Telnet → Telnet is a network protocol that transfers information from your device to other devices, such that they need to know. For example: When changing a password on the internet, the password needs to be set if you were to log onto the same account on a another computer.

A router is a device that helps information flow from network to network as well as keeps devices attached to the internet service. A router can help an individual set up a LAN (local area network) or a WLAN (wireless local area network). With a router used a gateway for internet access, it would be impossible to be in a wireless range without a router acting a connector and secure hold for devices with internet connection. A router is usually not as fast as a physical internet connection because it works over waves and satellites, and not with electricity.

A firewall refers to the security system (hardware or software), built into the computer that monitors mass information that comes into the hardware and software of the computer, and has the power to block information from entering the computer, protecting the device from any harm that might be entering into the machine, and can only be avoided by using the firewall to detect the harmful information.

An FTP or File Transfer Protocol and a webserver are very similar yet also different. A web server is something that we use daily on web 2.0. Web servers transfer information back and forth between our computers and the network to allow us to view their pages. This information isn’t saved into our computer’s memory but is held there until the pages are changed. A FTP is different because it is a direct connection between file servers. A two way exchange is created from both the computer and the server and are saved into both memories.

And IP address stands for Internet Protocol. Every computer and internet service has a address of their own. These addresses are codes that allow servers to know where to send information, and computer to send information back to servers themselves. These addresses allow for basic features such as search engines and Facebook. You can also upload specific files using file sharing servers such as Mediafire or FileShare, using the same process.

File transferring can be done in two ways. The first way, is simply receiving information from a server. For this you will need internet access, and a device that can connect to the internet. Any browser that is opened is automatically connected to a homepage. And that’s it, that homepage’s server has sent you its information and allowed it for your computer to access it. For the second, you will need to create an FTP. You can do this by downloading a program like Serv-U on both computers where you want to transfer files from.

1)      Create a login.

2)      Agree to all registrations.

3)      Enter the IP Address of the other computer you want to transfer to.

4)      Test the connection through the program.

5)      Voila.

Sources:

http://en.wikipedia.org/wiki/Computer_network

http://en.wikipedia.org/wiki/Node_(networking)

http://en.wikipedia.org/wiki/Local_area_network

http://en.wikipedia.org/wiki/Wide_area_network

http://en.wikipedia.org/wiki/Internet

http://en.wikipedia.org/wiki/Intranet

http://en.wikipedia.org/wiki/Metropolitan_area_network

http://en.wikipedia.org/wiki/Vpn

http://en.wikipedia.org/wiki/Peer-to-peer

http://www.differencebetween.net/technology/difference-between-client-and-server/

http://support.microsoft.com/kb/103884

https://www.ischool.utexas.edu/~l38613dw/readings/NotesOnInterconnection.html

http://netforbeginners.about.com/od/h/f/what-is-a-computer-protocol-http.htm

http://en.wikipedia.org/wiki/Transmission_Control_Protocol

http://en.wikipedia.org/wiki/File_Transfer_Protocol

http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

http://en.wikipedia.org/wiki/Telnet

http://www.webopedia.com/DidYouKnow/Hardware_Software/2005/router.asp

http://en.wikipedia.org/wiki/Firewall_(computing)