Top Banner
2004-2005 Academic Year, Spring Semester 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Bilkent University - Faculty of Art, Design and Architecture Design and Architecture Department of Communication and Design Department of Communication and Design CS 153 CS 153 Introduction to Introduction to Computing I Computing I Lesson 4 Lesson 4
28

2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Dec 17, 2015

Download

Documents

Raymond Carroll
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

2004-2005 Academic Year, Spring Semester2004-2005 Academic Year, Spring SemesterBilkent University - Faculty of Art, Design and Bilkent University - Faculty of Art, Design and

ArchitectureArchitectureDepartment of Communication and DesignDepartment of Communication and Design

CS 153 Introduction CS 153 Introduction

to Computing Ito Computing I Lesson 4Lesson 4

Page 2: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Review of Last LessonReview of Last Lesson<html><html>

  <head>  <head>    <title>MUSIC</title>    <title>MUSIC</title>  </head>  </head>  <body>  <body>WELCOME TO MY MUSIC PAGE WELCOME TO MY MUSIC PAGE This page is about pop music. I will list here my favorite This page is about pop music. I will list here my favorite singers and songs.singers and songs.My Favorite Singers:My Favorite Singers:StingStingDire StraitsDire StraitsGippsy KingsGippsy KingsMy Favorite Songs:My Favorite Songs:FragileFragileYour latest trickYour latest trickPharonPharon</body></body>

</html></html>

• Any HTML file starts with <html> and ends with </html>

• <title>...</title> is the title of the page and given in <head>...</head> part

• <body> ... </body> contains the information which will be displayed in the page

Page 3: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Header TagsHeader Tags

Change the part of your html code to:Change the part of your html code to:

<h2>WELCOME TO MY MUSIC <h2>WELCOME TO MY MUSIC PAGE </h2> PAGE </h2>

Header tags produce different sized headings.

Page 4: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

<p> and <br> tags <p> and <br> tags

Change the part of your html code to:Change the part of your html code to:<p>My Favorite Singers:<br><p>My Favorite Singers:<br>Sting<br>Sting<br>Dire Straits<br>Dire Straits<br>Gippsy Kings<br>Gippsy Kings<br><p>My Favorite Songs:<br><p>My Favorite Songs:<br>Fragile<br>Fragile<br>Your latest trick<br>Your latest trick<br>Pharon<br>Pharon<br>

<br> tag starts a new line.<p> tag skips a line then starts a paragraph.

Page 5: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

TAG ATTRIBUTE <p TAG ATTRIBUTE <p

align=center> <p>align=center> <p>

Change the part of your html code to:Change the part of your html code to:

<p align="center">My Favorite <p align="center">My Favorite Singers: </p>Singers: </p>

Attributes modify tags. align=center will shift the text to center. Other values for align are left, right

Page 6: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

<center> <center>

Change the part of your html code to:Change the part of your html code to:

<center>WELCOME TO MY MUSIC <center>WELCOME TO MY MUSIC PAGE </center>PAGE </center>

CENTER tag centers any object in the page

Page 7: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Background color <body Background color <body

bgcolor=yellow>bgcolor=yellow>

Change the part of your html code to:Change the part of your html code to:

<body bgcolor="lightyellow"><body bgcolor="lightyellow">

bgcolor attribute changes the background color of the page.background attribute adds a tiled image to the background of the page.

Page 8: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

ColorColor

http://www.w3schools.com/html/html_colornameshttp://www.w3schools.com/html/html_colornames.asp.asp

Any color can be given in two ways:Any color can be given in two ways:

1.1. By name; like "pink", "blue", "green", etc.By name; like "pink", "blue", "green", etc.

2.2. By Hexadecimal codes: Hexadecimal is a By Hexadecimal codes: Hexadecimal is a number system that has 16 numbers(base16-number system that has 16 numbers(base16-0123456789ABCDEF). 0123456789ABCDEF).

1.1. Different colors are formed by the combination of Different colors are formed by the combination of Red, Green, Blue. Such code will look like Red, Green, Blue. Such code will look like "#19A8FE". "#19A8FE".

2.2. "#000000" is black, "#FFFFFF" is white, "#000000" is black, "#FFFFFF" is white, "#FF0000" is red, "#00FF00" is green, "#0000FF" "#FF0000" is red, "#00FF00" is green, "#0000FF" is blue.is blue.

Page 9: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Changing the body text Changing the body text colorcolor

Change the part of your html code to:Change the part of your html code to:

<body text="#0000FF"> <body text="#0000FF">

Page 10: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Seperating the text with Seperating the text with <hr> (horizontal rule)<hr> (horizontal rule)

hr is an empty tag.hr is an empty tag.

Change the part of your html code to:Change the part of your html code to:

<hr> or <hr /><hr> or <hr />

width=number / number%, size=number, noshade, align=left / right / center, color=name / #hex code for RGB

Page 11: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Physical Style: <b> Physical Style: <b>

Change the part of your html code to:Change the part of your html code to:

<b>My Favorite Songs:</b> <b>My Favorite Songs:</b>

b tag changes the appearance of the enclosed text to bold.Note: In the nested usage of the tags, any opening and closing tag pair shouldn't cross the other pairs.

Page 12: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Physical Style: <i> Physical Style: <i>

Change the part of your html code to:Change the part of your html code to:

<i>Fragile</i> <i>Fragile</i>

i tag changes the appearance of the enclosed text to italic.

Page 13: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Physical Style: <u> Physical Style: <u>

Change the part of your html code to:Change the part of your html code to:

<u>Your latest trick</u> <u>Your latest trick</u>

Page 14: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Physical Style: <sub> Physical Style: <sub>

Add to your html code:Add to your html code:

<p>H<sub>2</sub>O <p>H<sub>2</sub>O

SUB tag changes the appearance of the enclosed text to subscript.

Page 15: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Physical Style: <sup> Physical Style: <sup>

Add to your html code:Add to your html code:

<p>10<sup>o</sup>C <p>10<sup>o</sup>C

SUP tag changes the appearance of the enclosed text to superscript.

Page 16: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Physical Style: <tt> Physical Style: <tt>

Add to the end of your html code:Add to the end of your html code:

<tt>OTHER GROUPS</tt><tt>OTHER GROUPS</tt>

TT tag is the type writer font.

Page 17: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Logical Styles: Logical Styles:

<em>...</em> = Emphasis<em>...</em> = Emphasis<strong>...</strong> = Stronger emphasis<strong>...</strong> = Stronger emphasis<code>...</code> = Display an HTML <code>...</code> = Display an HTML

directivedirective<samp>...</samp> = Include sample output<samp>...</samp> = Include sample output<kbd>...</kbd> = Display a keyboard key<kbd>...</kbd> = Display a keyboard key<var>...</var> = Define a variable<var>...</var> = Define a variable<dfn>...</dfn> = Display a definition (not <dfn>...</dfn> = Display a definition (not

widely supported)widely supported)<cite>...</cite> = Display a citation <cite>...</cite> = Display a citation

Page 18: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Text Elements: <pre>, Text Elements: <pre>, <listing> <listing>

Add to the end of your html code:Add to the end of your html code:

<pre><pre>   G r o u p                                  C D   G r o u p                                  C D   Era                                           Era   Era                                           Era   Santana                                       Santana                                    SmoothSmooth   Bueno Vista  Social Club             Bueno Vista  Social Club          Chan ChanChan Chan</pre>   </pre>  

PRE tag tells that text is already formatted, it must be displayed as it is. Permits some tags inside.LISTING tag does the same except it doesn't run the tags inside.

Page 19: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

<blockquote><blockquote> <blockquote><blockquote>

Write this and copy over and over again. Write Write this and copy over and over again. Write this and copy over and over again. Write this this and copy over and over again. Write this and copy over and over again. Write this and and copy over and over again. Write this and copy over and over again. Write this and copy copy over and over again. Write this and copy over and over again. Write this and copy over over and over again. Write this and copy over and over again. Write this and copy over and and over again. Write this and copy over and over again. Write this and copy over and over over again. Write this and copy over and over again. Write this and copy over and over again. again. Write this and copy over and over again. Write this and copy over and over again. Write Write this and copy over and over again. Write this and copy over and over again. Write this this and copy over and over again. Write this and copy over and over again. and copy over and over again. </blockquote></blockquote>

Defines a long quotation

Page 20: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

EntitiesEntities

httphttp://www.w3schools.com/html/html_entitiesref.://www.w3schools.com/html/html_entitiesref.aspasp

&keyword;&keyword;Display a particular character identified by a Display a particular character identified by a special keyword. special keyword. For example:For example:

the entity &lt; specifies the less than ( < ) character. the entity &lt; specifies the less than ( < ) character. Note that the semicolon following the keyword is requiredNote that the semicolon following the keyword is required

&#ascii_equivalent;&#ascii_equivalent;Use a character literally. Use a character literally. For example For example

the entity &#037;specifies (%) character. the entity &#037;specifies (%) character. Again note that the semicolon following the ASCII numeric Again note that the semicolon following the ASCII numeric

value is required. value is required.

Page 21: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

EntityEntity

A character entity has three parts: A character entity has three parts: an ampersand (&), an ampersand (&),

an entity name or an entity name or a # and an entity number, a # and an entity number,

and finally a semicolon (;). and finally a semicolon (;). The most common character entity in The most common character entity in

HTML is the non-breaking space. HTML is the non-breaking space. Normally HTML will truncate spaces Normally HTML will truncate spaces in your text. To add spaces to your in your text. To add spaces to your text, use the &nbsp; character entity text, use the &nbsp; character entity

Page 22: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

EntityEntity

Add to your html code:Add to your html code:

This is a text.This is a text.

This &nbsp; &nbsp; &nbsp; &nbsp; This &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; is a text.&nbsp; is a text.

Page 23: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

FontFont

Add to your html code:Add to your html code:

<font face="arial, verdana, comic <font face="arial, verdana, comic sans ms" size=10 color="green"> sans ms" size=10 color="green"> New Age Groups</font>New Age Groups</font>

Page 24: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Some ExercisesSome Exercises

Page 25: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Exercise 1Exercise 1

The address of background image is http://www.bilkent.edu.tr/~ussakli/images/fl1.gif

Page 26: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

SolutionSolution<html><html><head><head><title>Clemantis</title><title>Clemantis</title></head></head><body <body

background=background=http://www.bilkent.edu.tr/~ussakli/images/fl1.gif > >

<h1>Welcome to my Clemantis page.</h1><h1>Welcome to my Clemantis page.</h1><p>I would love to give some information about <p>I would love to give some information about

<b>clemantis</b>.</p><b>clemantis</b>.</p><h2>Where we can find information about clemantis flowers?<h2>Where we can find information about clemantis flowers?

</h2></h2><p>There are several web sites about clemantis, first of all you <p>There are several web sites about clemantis, first of all you

should check <big>International Clematis Society</big>.should check <big>International Clematis Society</big>.</body></body></html></html>

Page 27: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

Exercise 2Exercise 2

Page 28: 2004-2005 Academic Year, Spring Semester Bilkent University - Faculty of Art, Design and Architecture Department of Communication and Design CS 153 Introduction.

SolutionSolution<html><html><head><head><title>Definition of Information</title><title>Definition of Information</title></head></head><body bgcolor=black text=white><body bgcolor=black text=white><h1>Welcome!</h1><h1>Welcome!</h1><p>So what is <b>information</b>?</p><p>So what is <b>information</b>?</p><h2>A definition</h2><h2>A definition</h2><p><tt>Any communication or representation of knowledge such as <p><tt>Any communication or representation of knowledge such as

<u>facts</u>, <u>data</u>, or <u>opinions</u>, in <i>any</i> <u>facts</u>, <u>data</u>, or <u>opinions</u>, in <i>any</i> medium or form, including textual, numerical, graphic, cartographic, medium or form, including textual, numerical, graphic, cartographic, narrative, or audio-visual forms.</tt></p>narrative, or audio-visual forms.</tt></p>

<h2>Yet another definition</h2><h2>Yet another definition</h2><p><p>We can also define information as:<br>We can also define information as:<br>The meaning that a human extracts from data by means of known The meaning that a human extracts from data by means of known

conventions of the representation used." (Gould, 1971).</p>conventions of the representation used." (Gould, 1971).</p></body></body></html></html>