ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΙΑ ΙΚΤΥΟΥ

Σχετικά έγγραφα
EE512: Error Control Coding

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

Europe Code Week 7-22 Οκτωβρίου Μία γιορτή δημιουργίας με κώδικα

2 Composition. Invertible Mappings

Στην τεχνολογία των CSS, οι κανόνες στυλ (style

Εργαστήριο 9. Styling with Javascript

Γαβαλάς Δαμιανός Δικτυακά Πολυμέσα ΙΙ Εργαστήριο #3 0 : Εισαγωγή στacascading Style Sheets (CSS)

Η Βίβλος των CSS. Εισαγωγή στα CSS

ΕΠΛ 003: ΕΠΙΣΤΗΜΗ ΤΗΣ ΠΛΗΡΟΦΟΡΙΚΗΣ ΚΑΙ ΠΛΗΡΟΦΟΡΙΑΚΑ ΣΥΣΤΗΜΑΤΑ HTML

Θέματα Προγραμματισμού Διαδικτύου ~ CSS ~

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

The Simply Typed Lambda Calculus

CSS. Cascading Style Sheets. Γλώσσες και Τεχνολογίες Ιστού Τμήμα Πληροφορικής - ΑΤΕΙ Θεσσαλονίκης

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial

Εισαγωγή στην HTML. Κεφ. HTML + CSS

Σχεδιασμός και Ανάπτυξη Ιστότοπων

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

1. <body> 2. <header> 3. <h1> My Page </h1> 4. </header> 5. <section>

Homework 3 Solutions

Instruction Execution Times

Βασικά στοιχεία του CSS

Cascading Style Sheets

Finite Field Problems: Solutions

Galatia SIL Keyboard Information

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Section 8.3 Trigonometric Equations

Section 9.2 Polar Equations and Graphs

How to register an account with the Hellenic Community of Sheffield.

Εργαλεία Ανάπτυξης Εφαρμογών Internet. Δ.Ι.Ε.Κ. Γλυφάδας Τεχνικός Εφαρμογών Πληροφορικής

derivation of the Laplacian from rectangular to spherical coordinates

CSS Basic Styling. Έλαο θαλόλαο CSS (Cascading Style Sheets) απνηειείηαη από δύν θύξηα κέξε: ηελ επηινγή, θαη κία ή πεξηζζόηεξεο δηεπθξηλήζεηο:

Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά.

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Potential Dividers. 46 minutes. 46 marks. Page 1 of 11

<a href=" στο κείμενο</a>.

C.S. 430 Assignment 6, Sample Solutions

Paper Reference. Paper Reference(s) 1776/04 Edexcel GCSE Modern Greek Paper 4 Writing. Thursday 21 May 2009 Afternoon Time: 1 hour 15 minutes

Εισαγωγή στον Παγκόσμιο ιστό και στη γλώσσα Html. Χρ. Ηλιούδης

Cascading Style Sheets (CSS)

[1] P Q. Fig. 3.1

Διάλεξη 2η Εισαγωγή στο CSS

Website review lalemou.com

Math 6 SL Probability Distributions Practice Test Mark Scheme

Mean bond enthalpy Standard enthalpy of formation Bond N H N N N N H O O O

Block Ciphers Modes. Ramki Thurimella

Εισαγωγή σε HTML και CSS. Παναγιώτης Τσαρχόπουλος

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι

4.6 Autoregressive Moving Average Model ARMA(1,1)

ΤΕΧΝΟΛΟΓΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΤΜΗΜΑ ΝΟΣΗΛΕΥΤΙΚΗΣ

Σημασιολογικός Ιστός (Semantic Web) - XML

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Code Breaker. TEACHER s NOTES

5.4 The Poisson Distribution.

Modbus basic setup notes for IO-Link AL1xxx Master Block

Lecture 2. Soundness and completeness of propositional logic

Γλώσσα περιγραφής οδηγιών εµφάνισης-στοιχειοθέτησης

CSS. Εισαγωγή & Βασικές έννοιες. Cascading Style Sheets. Επικαλυπτόμενα φύλλα στυλ

Special edition of the Technical Chamber of Greece on Video Conference Services on the Internet, 2000 NUTWBCAM

Βαρβάκειο Πρότυπο Γυμνάσιο Εργαστήρι Πληροφορικής Σχολ. Έτος Φύλλο Εργασίας 5

Advanced Subsidiary Unit 1: Understanding and Written Response

6.1. Dirac Equation. Hamiltonian. Dirac Eq.

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

the total number of electrons passing through the lamp.

14 Lesson 2: The Omega Verb - Present Tense

Approximation of distance between locations on earth given by latitude and longitude

Οδηγίες χρήσης. Registered. Οδηγίες ένταξης σήματος D-U-N-S Registered στην ιστοσελίδα σας και χρήσης του στην ηλεκτρονική σας επικοινωνία

Επιβλέπουσα Καθηγήτρια: ΣΟΦΙΑ ΑΡΑΒΟΥ ΠΑΠΑΔΑΤΟΥ

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

Άσκηση 6 Επαναληπτική Άσκηση HTML

Συστήματα Διαχείρισης Βάσεων Δεδομένων

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

ΔΕ10: Πληροφοριακά Συστήματα Διοίκησης IΙ Εργαστήριο # 2

Σχεδιασμός και Ανάπτυξη Ιστοσελίδων ΙΙ ΙΕΚ ΤΡΙΑΝΔΡΙΑΣ ΓΡΑΦΙΣΤΑΣ ΕΝΤΥΠΟΥ ΚΑΙ ΗΛΕΚΤΡΟΝΙΚΩΝ ΜΕΣΩΝ. CSS - Cascading Style Sheets

Οδηγίες χρήσης υλικού D U N S Registered

Other Test Constructions: Likelihood Ratio & Bayes Tests

Calculating the propagation delay of coaxial cable

ΦΥΛΛΟ ΕΡΓΑΣΙΑΣ Α. Διαβάστε τις ειδήσεις και εν συνεχεία σημειώστε. Οπτική γωνία είδησης 1:.

Areas and Lengths in Polar Coordinates

Case 1: Original version of a bill available in only one language.

The challenges of non-stable predicates

ΕΡΓΑΣΤΗΡΙΑΚΗ ΑΣΚΗΣΗ 2 ΜΕΛΕΤΗ ΚΑΙ ΕΦΑΡΜΟΓΗ ΔΗΜΙΟΥΡΓΙΑΣ HTML ΣΕΛΙΔΩΝ ΣΥΝΔΕΣΜΟΙ

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

Macromedia DreamWeaver Παρουσίαση εργαλείου σχεδίασης διεπαφής χρήστη

ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

Τεχνολογίες Διαδικτύου (Εξασκηθείτε στην HTML)

3. ΕΙΣΑΓΩΓΗ ΣΤΟ CSS ΓΙΩΡΓΟΣ ΓΙΑΝΝΑΚΑΚΗΣ, ΜΑΝΩΛΗΣ ΤΣΙΚΝΑΚΗΣ

Numerical Analysis FMN011

(C) 2010 Pearson Education, Inc. All rights reserved.

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

Solutions to the Schrodinger equation atomic orbitals. Ψ 1 s Ψ 2 s Ψ 2 px Ψ 2 py Ψ 2 pz

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

SOAP API. Table of Contents

Section 7.6 Double and Half Angle Formulas

(1) Describe the process by which mercury atoms become excited in a fluorescent tube (3)

Fractional Colorings and Zykov Products of graphs

Transcript:

ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΙΑ ΙΚΤΥΟΥ HTLM CSS Lecture 2 ver. 2.03 Jan 2011 ρ. Γεώργιος Φ. Φραγκούλης 1

The HTML head Element The head element is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more. The following tags can be added to the head section: <title>, <base>, <link>, <meta>, <script>, and <style>. 2

The HTML title Element The <title> tag defines the title of the document. The title element is required in all HTML documents. The title element: defines a title in the browser toolbar provides a title for the page when it is added to favorites displays a title for the page in search-engine results 3

Example <html> <head> <title>title of the document</title> </head> <body> The content of the document... </body> </html> 4

The HTML base Element The <base> tag specifies a default address or a default target for all links on a page: <head> <base href="http://www.mypages.com/images/" /> <base target="_blank" /> </head> 5

The HTML link Element The <link> tag defines the relationship between a document and an external resource. The <link> tag is most used to link to style sheets: <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head> 6

The HTML style Element The <style> tag is used to define style information for an HTML document. Inside the style element you specify how HTML elements should render in a browser: <head> <style type="text/css"> body {background-color:yellow} p {color:blue} </style> </head> 7

HTML head Elements 8

The HTML meta Element Metadata is information about data. The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable. Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata. The <meta> tag always goes inside the head element. The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services. 9

Keywords for Search Engines Some search engines will use the name and content attributes of the meta element to index your pages. The following meta element defines a description of a page: <meta name="description" content="free Web tutorials on HTML, CSS, XML" /> The following meta element defines keywords for a page: <meta name="keywords" content="html, CSS, XML" /> The intention of the name and content attributes is to describe the content of a page. 10

Example <html> <head> <meta http-equiv="refresh" content="5;url=http://www.mypages.com" /> </head> <body> <h1>sorry! We have moved!</h1> <h2>the new URL is: <a href="http://www.mypages.com">http://www.mypages.com</a></h2> <p>you will be redirected to the new address in five seconds.</p> <p>if you see this message for more than 5 seconds, please click on the link above!</p> </body> </html> 11

The HTML script Element The <script> tag is used to define a client-side script, such as a JavaScript. The script element either contains scripting statements or it points to an external script file through the src attribute. The required type attribute specifies the MIME type of the script. Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content. The script below writes Hello World! to the HTML output: <script type="text/javascript"> document.write("hello World!") </script> 12

HTML Entities Some characters are reserved in HTML. It is not possible to use the less than (<) or greater than (>) signs in your text, because the browser will mix them with tags. To actually display reserved characters, we must use character entities in the HTML source code. A character entity looks like this: &entity_name; OR &#entity_number; 13

HTML Useful Character Entities 14

Advanced HTML CSS scripting What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem External Style Sheets cansavea lotofwork External Style Sheets are stored in CSS files 15

Styles Solved a Big Problem 16 HTML was never intended to contain tags for formatting a document. HTML was intended to define the content of a document, like: <h1>this is a heading</h1> <p>this is a paragraph.</p> When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a nightmare for web developers. Development of large web sites, where fonts and color information were added to every single page, became a long and expensive process. To solve this problem, the World Wide Web Consortium (W3C) created CSS. In HTML 4.0, all formatting could be removed from the HTML document, and stored in a separate CSS file. All browsers support CSS today.

Example <html> <head> <link rel="stylesheet" type="text/css" href="ex1.css" /> </head> <body> <h1>this header is 36 pt</h1> <h2>this header is blue</h2> <p>this paragraph has a left margin of 50 pixels</p> </body> </html> 17

Example (cont.) 18 This is the style sheet file (ex1.css): body { background-color:yellow; } h1 { font-size:36pt; } H2 { color:blue; } p { margin-left:50px; }

CSS Syntax A CSS rule has two main parts: a selector, and one or more declarations: The selector is normally the HTML element you want to style. Each declaration consists of a property and a value. The property is the style attribute you want to change. Each property has a value. 19

Example To make the CSS more readable, you can put one declaration on each line, like this: Example p { color:red; text-align:center; } 20

CSS Comments Comments are used to explain your code, and may help you when you edit the source code at a later date. Comments are ignored by browsers. A CSS comment begins with "/*", and ends with "*/", like this: /*This is a comment*/ p { text-align:center; /*This is another comment*/ color:black; font-family:arial; } 21

The id Selector The id selector is used to specify a style for a single, unique element. The id selector uses the id attribute of the HTML element, and is defined with a "#". The style rule below will be applied to the element with id="para1": Example #para1 { text-align:center; color:red; } 22

Example 23 <html> <head> <style type="text/css"> #para1 { text-align:center; color:red; } </style> </head> <body> <p id="para1">hello World!</p> <p>this paragraph is not affected by the style.</p> </body> </html>

The class Selector The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements. This allows you to set a particular style for any HTML elements with the same class. The class selector uses the HTML class attribute, and is defined with a "." In the example below, all HTML elements with class="center" will be center-aligned: Example.center {text-align:center;} 24

Example <html> <head> <style type="text/css">.center { text-align:center; } </style> </head> 25 <body> <h1 class="center">center-aligned heading</h1> <p class="center">center-aligned paragraph.</p> </body> </html>

Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style sheet Inline style 26

External Style Sheet An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section: <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head> An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a.css extension. An example of a style sheet file is shown below: hr {color:red;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} 27

Internal Style Sheet An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this: <head> <style type="text/css"> hr {color:red;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} </style> 28

Inline Styles An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly! Touseinlinestylesyouusethestyleattributeinthe relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph: <p style="color:red;margin-left:20px">this is a paragraph.</p> 29

Multiple Styles Will Cascade into One Styles can be specified: inside an HTML element inside the head section of an HTML page in an external CSS file Tip: Even multiple external style sheets can be referenced inside a single HTML document. 30

Cascading order What style will be used when there is more than one style specified for an HTML element? Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority: Browser default External style sheet Internal style sheet (in the head section) Inline style (inside an HTML element) So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value). Note: If the link to the external style sheet is placed after the internal style sheet in HTML <head>, the external style sheet will override the internal style sheet! 31

Div Div (short for division) divides the content into individual sections. Each section can then have its own formatting, as specified by the CSS. Div is a block-level container, meaning that there is a line feed after the </div> tag. For example, if we have the following CSS declaration:.large { color: green; font-family:arial; font-size: 4pt; } 32

Div The HTML code <div class="large"> This is a DIV sample. </div> gets displayed as This is a DIV sample. 33

Span Span is similar to div in that they both divide the content into individual sections. The difference is that span goes into a finer level, so we can span to format a single character if needed. There is no line feed after the </span> tag. For example, if we have the following CSS declaration:.largefont { color: red; font-family:arial; font-size: 6px; } 34

Span The HTML code Span is not at the <span class="largefont">block level</span>. gets displayed as Span is not at the block level. 35

CSS Background CSS background properties are used to define the background effects of an element. CSS properties used for background effects: background-color background-image background-repeat background-attachment background-position 36

Background Color The background-color property specifies the background color of an element. The background color of a page is defined in the body selector: Example body {background-color:#b0c4de;} 37

Example 38 <html> <head> <style type="text/css"> body { background-color:#b0c4de; } </style> </head> <body> <h1>my CSS web page!</h1> <p>hello world! This is an example.</p> </body> </html>

Background color The background color can be specified by: name - a color name, like "red" RGB - an RGB value, like "rgb(255,0,0)" Hex - a hex value, like "#ff0000" In the example below, the h1, p, and div elements have different background colors: Example h1 {background-color:#6495ed;} p {background-color:#e0ffff;} div {background-color:#b0c4de;} 39

Background Image The background-image property specifies an image to use as the background of an element. By default, the image is repeated so it covers the entire element. The background image for a page can be set like this: Example body {background-image:url('paper.gif');} 40

Text Color The color property is used to set the color of the text. The color can be specified by: name - a color name, like "red" RGB - an RGB value, like "rgb(255,0,0)" Hex - a hex value, like "#ff0000" The default color for a page is defined in the body selector. Example body {color:blue;} h1 {color:#00ff00;} h2 {color:rgb(255,0,0);} 41

Text Alignment The text-align property is used to set the horizontal alignment of a text. Text can be centered, or aligned to the left or right, or justified. When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers). Example h1 {text-align:center;} p.date {text-align:right;} p.main {text-align:justify;} 42

Example <html> <head> <style type="text/css"> h1 {text-align:center;} p.date {text-align:right;} p.main {text-align:justify;} </style> </head> <body> <h1>css text-align Example</h1> <p class="date">jan, 2011</p> <p class="main">in my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. 'Whenever you feel like criticizing anyone,' he told me, just remember that all the people in this world haven't had the advantages that you've had.'</p> <p><b>note:</b> Resize the browser window to see how the value "justify" works.</p> </body> 43 </html>

Text Decoration The text-decoration property is used to set or remove decorations from text. The textdecoration property is mostly used to remove underlines from links for design purposes: Example h1 {text-decoration:overline;} h2 {text-decoration:line-through;} h3 {text-decoration:underline;} h4 {text-decoration:blink;} 44

CSS Font Families In CSS, there are two types of font family names: generic family - a group of font families with a similar look (like "Serif" or "Monospace") font family - a specific font family (like "Times New Roman" or "Arial") 45

Fonts Family 46

Font Style Thefont-stylepropertyismostlyusedtospecifyitalic text. This property has three values: normal - The text is shown normally italic - The text is shown in italics oblique - The text is "leaning" (oblique is very similar to italic, but less supported) Example p.normal {font-style:normal;} p.italic {font-style:italic;} p.oblique {font-style:oblique;} 47

CSS Lists In HTML, there are two types of lists: unordered lists - the list items are marked with bullets ordered lists - the list items are marked with numbers or letters With CSS, lists can be styled further, and images can be used as the list item marker. 48

Different List Item Markers The type of list item marker is specified with the list-style-type property: Example ul.a {list-style-type: circle;} ul.b {list-style-type: square;} ol.c {list-style-type: upper-roman;} ol.d {list-style-type: lower-alpha;} 49

CSS Tables The look of an HTML table can be greatly improved with CSS Table Borders To specify table borders in CSS, use the border property. The example below specifies a black border for table, th, and td elements: Example table, th, td { border: 1px solid black; } 50

Table Width and Height Width and height of a table is defined by the width and height properties. The example below sets the width of the table to 100%, and the height of the th elements to 50px: Example table { width:100%; } th { height:50px; } 51

Table Text Alignment The text in a table is aligned with the text-align and vertical-align properties. The text-align property sets the horizontal alignment, like left, right, or center: Example td { text-align:right; } 52

Table Color The example below specifies the color of the borders, and the text and background color of th elements: Example table, td, th { border:1px solid green; } th { background-color:green; color:white; } 53