Cascading Style Sheets III B. Com (Paper - VI) & III B

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
Cascading Style Sheets (CSS). Cascading Style Sheets With the explosive growth of the World Wide Web, designers and programmers quickly explored and reached.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets
Cascading Style Sheets
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
Today CSS HTML A project.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
Introduction to CSS.
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.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา 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.
Cascading Style Sheets SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
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.
4.01 Cascading Style Sheets
 Missing (or duplicate) semicolons can make the browser completely ignore the style rule.  You may add extra spaces between the properties/values to.
STYLING THE WEBSITE - EXTERNAL CSS BY JORGE MARTINEZ.
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.
Cascading style sheets (CSS)
Cascading Style Sheet (CSS)
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.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
 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)
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
INTRODUCTION TO CSS. TOPICS TO BE DISCUSSED……….  Introduction Introduction  Features of CSS Features of CSS  Creating Style Sheet Creating Style Sheet.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
Introduction to CSS. What is CSS? CSS ("Cascading Style Sheets") determines how the elements in our XHTML documents are displayed and formatted. By using.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
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…
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.
Getting Started with CSS
4.01 Cascading Style Sheets
>> Introduction to CSS
Introduction to CSS.
Madam Hazwani binti Rahmat
Cascading Style Sheets (CSS)
Introduction to Web programming
Intro to CSS CS 1150 Fall 2016.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
Introduction to CSS.
Intro to CSS CS 1150 Spring 2017.
DynamicHTML Cascading Style Sheet Internet Technology.
CS134 Web Design & Development
Introduction to Cascading Style Sheets (CSS)
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
Cascading Style Sheets™ (CSS)
DynamicHTML Cascading Style Sheet Internet Technology.
Training & Development
Introduction to CSS.
Made By : Lavish Chauhan & Abhay Verma
Web Design & Development
Session 3: Basic CSS Spring 2009
Cascading Style Sheets - Building a stylesheet
4.01 Cascading Style Sheets
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
Introduction to Cascading Style Sheets (CSS)
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Cascading Style Sheets III B. Com (Paper - VI) & III B Cascading Style Sheets III B.Com (Paper - VI) & III B.Sc (Paper - VIIC) Web Technologies By S.Vinila Kumari, Dept.of Computer Science

Outline Introduction What is CSS ? Types of selectors Different ways of CSS Advantages of CSS Conclusion References

Introduction HTML tags only provide limited formatting We can manually change the format for all the H1 headlines, but what about we have 100 pages in our website?

Introduction <html> <body bgcolor=“cyan”> <h2><font color=“blue”> I am blue</h1> <h3><font color=“blue”>I am blue</h2> </body> </html>

Introduction

Introduction

Introduction CSS Created by Hakon Wium Lie in 1994 HTML is used to structure content. CSS is used to formatting structured content

Introduction

Introduction

Introduction CSS helps web developers to create a uniform look across number of pages of a website

Introduction Former with CSS all of this formatting information was made directly in the document either in the form of attributes like height or width.

CSS MEANS? Cascading : refers to the procedure that determines which style will apply to a certain section , if we have more than one style rule

CSS MEANS? Style : how we want a certain part of our page to look. we can set things like color, margins, font etc for things like tables, paragraphs and headings.

CSS MEANS? Sheets:the “sheets” are like templates or a set of rules, for determining how the web page will look.

CSS MEANS? So, CSS (all together) is a styling language – a set of rules to tell the browsers how our web page should look

Structure of CSS The CSS rules are made up of 5 parts: selector declaration property / value declaration block curly braces

Selector Definition: The HTML element we want add style to. <p> <h1> <table> etc

Selector {declaration;} Declaration = {property: value;} Definition: The statement of style for that element. Selector {declaration;} Declaration = {property: value;}

Property & Value Each property has a value. : (Colon) – Seperates property & value ; (Semicolon) – seperates pairs from each other

Property & Value Property : What particular we need to format ex: color, font, margins etc. Value : The exact settings for that format ex : red, italic, 40px etc.

Value 2px pixels 1mm millimeters 2cm centimeters 0.2in inches

Declaration Block Definition: multiple declaration lines including the curly braces

Curly Braces Definition: the curly braces contain the properties of the element we want to manipulate, and the values that we want to change them to .

Structure of CSS

Selector {property: value;} This is the text in this paragraph. Implement examples Selector {property: value;} p {color: yellow;} This is the text in this paragraph. p

Selector {property: value;} Implement examples Selector {property: value;} p {color: red; background-color: yellow;} p This is my link

Types of selectors p

The Universal selector Rather than selecting elements of a specific type, this selector quite simply matches the name of any element type * { color: green; } p

The Grouping selector h1, h2, h3 { color: green; } We can apply a style to many selectors just separate the selectors with a comma h1, h2, h3 { color: green; } p

Class Selector Here we can use the same class on multiple elements Syntax: .class name { css declarations; }

Class Selector CSS <html> <head> <style> .intro {background-color:yellow; color:red} </style></head> <body> <h1 class=“intro”> css</h1> <p class=“intro”> css </p> </body> </html>

Class Selector

ID Selector An ID is like a class but can be applied only once in a document.

ID Selector CSS <html> <head> <style> # foo {color: red;} </style> </head> <body> <h1 ID=“foo”> css</h1> </body> </html>

Difference between Class & ID We can’t have more than one tag with the same ID value We can apply the same class value to multiple document tags

Different methods of CSS

Inline Style Applies styles directly to the elements by adding declarations into the style Styles can be assigned to the desired content

Inlined Example <body> <p style=“text-align: center; color: red;”> What was I thinking? </p> </body> What was I thinking?

Internal Style Sheet Applies styles to HTML by placing the CSS rules inside the tag <style> inside the document tag <head> Styles can be assigned to whole content of the document

Internal Style Sheet <head> <style> { text-align: left; font-family: verdana; } </style> </head>

External Style Sheet Styles can be defined for multiple documents Applies styles as a separate file with a .css extension

Introduction

External Style Sheet Creation of CSS file: h2{ font-weight: bold; Border size: 5; color: green } Save the above code with a file name “ gdc.css ”

External Style Sheet Example : <html> <head> <link rel="stylesheet" href=“gdc.css”> </head> <body> </body> </html> Link to a seperate CSS page

Advantages of Cascading style sheets (CSS) CSS saves time Pages load faster Easy maintenance Superior style to HTML Multiple device compatibility Global web standards

CSS Div and Span Div (Short for division) divides the content into individual sections. Div is a block level container , meaning that there is a line feed after the </div> tag.

CSS Div and Span Example: .edit { color: red; text-decoration: underline; }

CSS Div and Span Example: <div class="edit"> <h4> This is a paragraph </h4> <h5> This is another paragraph </h5> <p> This is a next paragraph </p> </div>

CSS Div and Span Output: This is a heading This is another paragraph This is a next paragraph

CSS Div and Span Span is similar to div. The difference is that , we can span to format a single character if needed. There is no line feed after the </span> tag.

CSS Div and Span Example: <p> This is a <span class="edit"> paragraph </span> </p>

CSS Div and Span Output: This is a paragraph

CSS Layers To create a layer all we need to do is assign the position attribute to our style. The position can be either absolute or relative.

CSS Layers The position itself is defined with the top and left properties. Finally, which layer is on top is defined with the z-index attribute.

CSS Layers

CSS Layers <div style="position:relative; font-size:50px; z-index:1;">LAYER 1 </div> <div style="position:relative; top:-50; left:5; color:red; font-size:80px; z-index:2">LAYER 2</div>

CSS Layers

CSS Layers <div style="position:relative; font-size:50px; z-index:2;">LAYER 1 </div> <div style="position:relative; top:-50; left:5; color:red; font-size:80px; z-index:1">LAYER 2</div>

CSS Layers

Conclusion Structure of the CSS Inline, Internal, External Style What is CSS? Structure of the CSS Inline, Internal, External Style Advantages of Styles

Important Questions Define Style? Explain about the Cascading Style Sheets? Write about the different ways of defining style sheets? Describe the purpose of CSS. Also explain its features?

References 2. CSS : The Definitive Guide - Eric A.Meyer , 3rd Editon 1. Web programming Building Internet Appliactions – Chris Bates, 2nd Edition 2. CSS : The Definitive Guide - Eric A.Meyer , 3rd Editon 3. www.w3schools.com

THANK YOU