Cascading style sheet TNPW1 Ing. Jiří Štěpánek.

Slides:



Advertisements
Similar presentations
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Advertisements

Cascading Style Sheets (CSS). Cascading Style Sheets With the explosive growth of the World Wide Web, designers and programmers quickly explored and reached.
Cascading Style Sheets
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
/k/k 1212 Cascading Style Sheets Part one Marko Boon
Cascading Style Sheets
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Tutorial 3 Introducing Cascading Style Sheets. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Learn about Cascading Style Sheets Write.
Using Cascading Style Sheets CSS Basics. Goals Understand basic syntax of Cascading Style Sheets (CSS) Understand basic syntax of Cascading Style Sheets.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
CSS Basics LIS Webteam April 8, Why CSS? What’s wrong with HTML? Structure vs Style Early web design used hacks to style webpages with HTML – like.
4.01 Cascading Style Sheets
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Css. Definition Cascading style sheet (CSS) Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
CO1552 – Web Application Development Cascading Style Sheets.
Form Tag How to use Form Tag Something NEW ? PARAMETER Attribute NAME Specifies the name for a form To specify which form to submit with JavaScript, this.
ALBERT WAVERING BOBBY SENG. Week 2: HTML + CSS  Quiz  Announcements/questions/etc  Some functional HTML elements.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
CSS Cascading Style Sheets *referenced from
CSS Cascading Style Sheets. Session Checklist ► Learn why style sheets are needed and their advantages and disadvantages ► Learn the format of a style.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
CSS (Cascading Style Sheets). CSS CSS – Cascading Style Sheets – Cascade because of the way CSS rules can stack on top of each other. Allows you to add.
WebD Introduction to CSS By Manik Rastogi.
Web Development & Design Foundations with XHTML
CS3220 Web and Internet Programming CSS Basics
Style Sheets.
HTML5 and CSS3 Illustrated Unit D: Formatting Text with CSS
4.01 Cascading Style Sheets
An Introduction to Cascading Style Sheets
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
( Cascading style sheet )
CSS Rule Selector Declaration Block Value Attribute Name body {
>> Introduction to CSS
Cascading Style Sheets
Cascading Style Sheets
Madam Hazwani binti Rahmat
>> CSS Rules Selection
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Introduction to Web programming
Intro to CSS CS 1150 Fall 2016.
CASCADING STYLE SHEET CSS.
Introduction to CSS.
Introduction to Web programming
Intro to CSS CS 1150 Spring 2017.
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Introduction to Cascading Style Sheets (CSS)
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
The Internet 10/6/11 Cascading Style Sheets
Tutorial 3 Working with Cascading Style Sheets
Web Design and Development
CS3220 Web and Internet Programming CSS Basics
Part 1: Cascading Style Sheets
CS3220 Web and Internet Programming CSS Basics
Made By : Lavish Chauhan & Abhay Verma
Web Design & Development
Lesson 3: Cascading Style Sheets (CSS) and Graphical Elements
Cascading Style Sheets
4.01 Cascading Style Sheets
External Style Sheets.
Stylin’ with CSS.
Cascading Style Sheets III B. Com (Paper - VI) & III B
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Cascading style sheet TNPW1 Ing. Jiří Štěpánek

Design and content Web page can be divided into two parts Design Visual design of page Graphics design is based on creative work (layout design, images, fonts etc..) Content Data on page (texts, paragraphs, data in table) Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Design and content The main purpose of web page is to present information The type of design depends on: Page type Range of presented information Development technologies Client requirements Modern trends Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Design and content In modern way of web page creating design code and content code are in separate files <font color="red" face="Arial">Warning</font> In this case are font color and font face defined in attribute font. This way of coding makes impossible to re-use this design code. When change of design needed, all font elements must be rewritten. In modern way is design code and content code separated. Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Layout Visual layout of page Layout creation is separated from page programming Layout can be understood as a page template consisting of HTML elements, cascading style sheets, images etc. Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Table layout The whole page is based on HTML table element, in some cases with nested tables. Advantages Easy to understand Functional even if style sheet not available, compatible in all browsers Disadvantages Arcane code Changing the design means many changes in source code – redesigning whole table Problems with adaptability – i.e. in mobile devices Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Layout based on CSS Page is set of areas (divisions) and elements. The design is defined in separate file. Advantages Source code is easily sustainable Separating design code and content code Variability, efficiency, adaptability Disadvantages Not so easy to understood There can be browser compatibility problems – need to check page in different browsers Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Cascading style sheets (CSS) Visual formatting rules for (X)HTML elements mostly defined in separate file. This concept allows and supports: Reusability of defined styles Separating design code and content code Design change can be done by simple substitution of CSS files Target formatting rules for different devices (printer, mobile etc.) Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Using CSS on page Inline element styling No reusability, for all media Using element <style> (in <head>) Reusability within the page, media can be defined Declaring styles in external file The best practice, css file can be linked in other HTML files <p style="color:black; font-weight:bold;">Text</p> <style type="text/css" media="screen"> p {color: black; font-family: Tahoma;} </style> <link rel="stylesheet" type="text/css" href="style.css" media="screen" /> Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

CSS styles - rule Example – styling paragraphs p { Selector p { font-family: Verdana; font-size: 12px; color: red; } List of definitions Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Selector types Relation – element type (name) Relation – class XHTML: CSS: Relation – class Relation - id <p>text</p> p {font-family: Verdana;} <p class=“myparagraph">text</p> .myparagraph {font-family: Verdana;} <p id=“myuniqueparagraph">text</p> #myuniqueparagraph {font-family: Verdana;} Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

CSS units Numbers Size units Percent Color Integers with or without sign (14;-5;+9) Real numbers (0.5) Size units em – relative unit– size „M“ of current font ex – same as em but „x“ (approx. ½ em) px – pixel cm – centimeter in – inch Percent Rel. unit, with or without sign (25%; -5%; 50,5%) Color Keywords (black, blue, silver, red…) Numeric rgb(80, 50,255), rgb(10%,20%,30%). Range is 0-255 In hexadecimal (#RRGGBB) - #0000FF (pure blue) Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Comments Commenting your CSS code Between /* and */ No functional purpose, browser ignores them Technologie pro publikování na webu 1, Ing. Jiří Štěpánek

Sources Where can I find list of properties used to format elements? http://www.w3schools.com/css/default.asp Technologie pro publikování na webu 1, Ing. Jiří Štěpánek