Cascading Style Sheet.

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

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.
Ideas to Layout Beginning web layout using Cascading Style Sheets (CSS). Basic ideas, practices, tools and resources for designing a tableless web site.
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.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Review HTML  What is HTML?  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
CSS Style Rules Guang Tong, Zhan L;lo’p[ Css Style Rule Guang Tong Zhan Three ways to insert CSS 1 External style sheet 2 Internal style sheet 3 Inline.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
To Proudly supported by ferrycake.com. We will be printing Cash for your Community tokens every week in the Carmarthen Journal and Llanelli Star. The.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
Introduction To CSS.. HTML Review What is HTML used for? Give some examples of formatting tags in HTML? HTML is the most widely used language on the Web.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
INTRODUCTION TO CSS. OBJECTIVES: D EFINE WHAT CSS IS. K NOW THE HISTORY OF CSS. K NOW THE REASON WHY CSS IS USED. CSS SYNTAX. CSS ID AND CLASS.
CSS Basic (cascading style sheets)
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
DIV, Span, CSS.
Cascading Style Sheets CSS. Source W3Schools
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Introduction To CSS by: Alexandra Vlachakis Sandy Creek High School, Fayette County Schools Content and Resources Used With Permission: Interact With Web.
CSS Syntax. Syntax The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value}
CSS DHS Web Design. Location Between the & Start with – End with –
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
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.
Introduction To CSS. Lesson 1: History of CSS CSS was proposed in 1994 as a web styling language. To helps solve some of the problems HTML 4. There were.
WEB FOUNDATIONS CSS Overview. Outline  What is CSS  What does it do  Where are styles stored  Why use them  What is the cascade effect  CSS Syntax.
Fall 2016 CSULA Saloni Chacha
De-Blackboxing WordPress Communication, Culture and Technology (CCT)
CSS.
Cascading Style Sheet.
Getting Started with CSS
CSS Classes.
4.01 Cascading Style Sheets
UNIT-II CSS.
>> Introduction to CSS
Introduction to CSS.
Cascading Style Sheets
Introduction to the Internet
Cascading Style Sheets (CSS)
Introduction to Web programming
Intro to CSS CS 1150 Fall 2016.
Cascading Style Sheet (CSS)
CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
CSS Cascading Style Sheets
Website Design 3
Cascading Style Sheets - Building a stylesheet
Introduction to CSS.
Intro to CSS CS 1150 Spring 2017.
CSS.
DynamicHTML Cascading Style Sheet Internet Technology.
Introduction to Cascading Style Sheets (CSS)
What are Cascading Stylesheets (CSS)?
DynamicHTML Cascading Style Sheet Internet Technology.
Introduction to CSS.
Web Design & Development
Cascading Style Sheets - Building a stylesheet
Stylin’ with CSS.
4.01 Cascading Style Sheets
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
CSS Classes.
Cascading Style Sheets III B. Com (Paper - VI) & III B
Web Programming and Design
INTERNATIONAL INSTITUTE OF IFORMATION TECHNOLOGY, (I²IT)
Introduction to Cascading Style Sheets (CSS)
CASCADING STYLE SHEET WEB TECHNOLOGY
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Cascading Style Sheet

Introduction 1

Kecantikan yang abadi terletak pada keelokkan adab dan ketinggian ilmu seseorang, bukan terletak pada wajah dan pakaiannya - Hamka

INTRODUCTION Cascading Style Sheets also known as CSS. CSS describes how HTML elements are to be displayed on screen, paper, or in other media CSS saves a lot of work. Control the layout of multiple web pages all at once.

WHAT IS MULTIPLE PAGES http://www.w3schools.com/css/css_intro.asp

WHY CSS? CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes. body { background-color: #d0e4fe; } p { font-family: "Times New Roman"; font-size: 20px; } h1 { color: orange; text-align: center; }

HTML vs CSS Development of large websites that using FULL HTML syntax, 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. CSS removed the style formatting from the HTML page!

HTML vs CSS <!DOCTYPE html> CSS <html> <body> <head> <style> p { color: red; } </style> </head> <p> This is a paragraph.</p> </body> </html> CSS HTML vs CSS HTML <!DOCTYPE html> <html> <body> <p style="color:red;">This is a paragraph.</p> </body> </html>

CSS SYNTAX A CSS rule-set consists of a selector and a declaration block: p { color: red; text-align: center; } selector semicolons semicolon curly braces declaration declaration curly braces p { color:red ; text-align:center ; }

CSS SYNTAX The selector points to the HTML element you want to style. The declaration block contains one or more declarations separated by semicolons. Each declaration includes a CSS property name and a value, separated by a colon. A CSS declaration always ends with a semicolon, and declaration blocks are surrounded by curly braces.

CSS Selectors 2

The element Selector The element selector selects elements based on the element name. You can select all <p> elements on a page. (See example)

The element Selector <!DOCTYPE html> <html> <head> <style> h1 { text-align: center; color: red; } </style> </head> <body> <p>Every paragraph will be affected by the style.</p> <p id="para1">Me too!</p> <h1>And me!</h1> </body> </html>

The id Selector The id selector uses the id attribute of an HTML element to select a specific element. The id of an element should be unique within a page, so the id selector is used to select one unique element. To select an element with a specific id, write a hash (#) character, followed by the id of the element. (See example)

The id Selector <!DOCTYPE html> <html> <head> <style> #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 selects elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the name of the class. In the example below, all HTML elements with class="center" will be red and center-aligned (see example)

The class Selector <!DOCTYPE html> <html> <head> <style> .ua { text-align: center; color: red; } </style> </head> <body> <h1 class=“ua">Red and center-aligned heading</h1> <p class=“ua">Red and center-aligned paragraph.</p> </body> </html>

The class Selector (other example) <!DOCTYPE html> <html> <head> <style> p.center { text-align: center; color: red; } </style> </head> <body> <h1 class="center">This heading will not be affected</h1> <p class="center">This paragraph will be red and center-aligned.</p> </body> </html>

The class Selector (another example) <!DOCTYPE html> <html> <head> <style> p.center { text-align: center; color: red; } p.large { font-size: 300%; </style> </head> <body> <h1 class="center">This heading will not be affected</h1> <p class="center">This paragraph will be red and center-aligned.</p> <p class="center large">This paragraph will be red, center-aligned, and in a large font-size.</p> </body> </html>

Grouping Selectors Let say we have same style definition such : h1 {    text-align: center;    color: red; } h2 {    text-align: center;    color: red; } p {    text-align: center;    color: red; } It will be better to group the selectors, to minimize the code. To group selectors, separate each selector with a comma.

Grouping Selectors <!DOCTYPE html> <html> <head> <style> h1, h2, p { text-align: center; color: red; } </style> </head> <body> <h1>Hello World!</h1> <h2>Smaller heading!</h2> <p>This is a paragraph.</p> </body> </html>

CSS Comments Comments are used to explain the code, and may help when you edit the source code at a later date. Comments are ignored by browsers. (not appear in your web pages) A CSS comment starts with /* and ends with */.

CSS Comments <!DOCTYPE html> <html> <head> <style> p { color: red; /* This is a single-line comment */ text-align: center; } /* This is a multi-line comment */ </style> </head> <body> <p>Hello World!</p> <p>This paragraph is styled with CSS.</p> <p>CSS comments are not shown in the output.</p> </body> </html>

Do the seven exercise given.

nurazila@unimap.edu.my / 016-415 6936 THANKS! Any questions? You can find me at nurazila@unimap.edu.my / 016-415 6936