SlideShare a Scribd company logo
Week 3 css
CSS - what? Cascade Style Sheets Defines how to display HTML elements (fonts, size, colors, background images, border, styles) Add to HTML 4.0 Stored in CSS files All browsers support CSS Defined by the World Wide Web consortium (W3C) CSS Website Example http:// www.csszengarden.com /
CSS - why??? Advantages Saves time editing (define once on the element, next time the elements will automatically defined) Page load faster Easy maintenance Superior styles to HTML (much wider array of attributes) Disadvantage Browser compatibility
syntax A CSS rule has two main parts: a selector, and one or more declarations The selector is 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.
how to ?? Text editors Notepad/WordPad for Windows; TextEdit for Mac Dreamweaver has a function embedded into the program. Comments /* This is for CSS. */  Grouping h1, h2, h3 {color: blue;} Applying multiple properties h1 {color: blue; font-size: 150%; font-family: arial, Helvetica, “sans serif”; }
inline and internal styles  <html> <head>  <title>Project One</title> </head>    < body    >  <p  > This is a red page. </p>  </body> </html>  <style type=&quot;text/css&quot;> body {background-color: #ff0000;} p {color: blue; margin-left:20px;} </style> style=&quot;background-color: #ff0000;&quot; style=&quot;color:blue;margin-left:20px ;&quot;
external style (1) Create a text file and save as .css Create a link in HTML document The css style sheet contains only styles
external style – where to put it?
p{margin-left:20px;} body{background-color:#ff0000;}  external style – how to write it? mystyle.css project.html <html> <head>  <title>Project One</title> <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot;  href=“mystyle.css&quot; /> </head> <body> ...
cascade order Styles can be specified: Inside an HTML element (in-line) Inside the head section of an HTML page (internal) In an external CSS style sheet (external) All the styles will cascade into a new style sheet by the following rules, where number 1 has the highest priority: inline style internal style external style browser default
CSS code reference Text Color body {color:blue} h1 {color:#00ff00} h2 {color:rgb(255,0,0)} Text Alignment h1 {text-align:center} p.date {text-align:right} p.main {text-align:justify}  Text Decoration h1 {text-decoration:overline} h2 {text-decoration:line-through} h3 {text-decoration:underline} h4 {text-decoration:blink}
CSS code reference font p { font-style: italic; font-weight: bold; font-size: 30px; font-family: arial, sans-serif;} Using the short hand property, the code can be simplified: p { font: italic bold 30px arial, sans-serif; }
CSS code reference link  a:link  {color: blue;} (unvisited link) a:visited  {color: red;} a:active  {background-color: #ffff00;}   (active link) a:hover  {color: orange; font-style: italic;  letter-spacing: 10px; font-weight:bold;  text-transform: uppercase;  background-color:yellow;}
4 selector types Tag: re-define an existing HTML element ID:  applies to only one HTML element Class:  applies to any HTML element Compound:  used to combine two or more style rules to create a style definition that displays only when one style is contained within another.  Read:  CSS selectors: tags, ID, class and compound
tag
ID  #id 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 &quot;#&quot;. <html> <head> <style type=&quot;text/css&quot;> #para1 {text-align:center; color:red;}  </style> </head> <body> <p  id=&quot;para1&quot; >Hello World!</p> <p>This paragraph is not affected.</p> </body> </html> Hello World! This paragraph is not affected. P P P P
CLASS  .classname used to specify a style for different elements.  allows you to set a particular style for any html elements with the same class.  uses the html class attribute, and is defined with a &quot;.&quot; P h1 h4 h2
CLASS (example) <html> <head> <style type=&quot;text/css&quot;> .center{text-align:center;} </style> </head> <body> <h1  class=&quot;center&quot; >center-aligned heading</h1> <p  class=&quot;center&quot; >center-aligned paragraph.</p>  /body> </html> center-aligned heading center-aligned paragraph.
recap 3 places inline internal style (between <head></head>) external style (save as .css, html links in the head section) Selectors tag style (applies globally to an individual HTML tag) Id style (format a unique item on a page) class style (format more than 1 item at the same time) compound style
Set up the working space Click  Window  tab > click  CSS style  to open CSS panel On Properties panel, choose  CSS  tab
create a new CSS style CSS style panel highlight the text or image or table +  add new CSS rule >selector (class, id, tag, or compound) name internal or external or defined .css file define elements Properties Panel click  CSS  mode highlight the text or image targeted rule:  new CSS rule>edit rule> open a window > choose the appropriate selector - class, id, tag, or compound > name it  define the elements
apply existing styles Properties Panel For non-text elements, find  class   button and click the arrow, choose the existing  class  from the list; For text elements, click  CSS mode> targeted rule , choose the existing class from the list.
remove a style Property panel: <HTML> mode >class>none or <CSS> mode> targeted rule>remove class ** It only remove the style form the item, but the class is still there.
style, style, more style Edit Styles Find the rule in CSS panel Click on it Change it in the window Rename a class style Properties Panel > class menu>rename or Right click the rule in CSS panel Duplicate a style CSS style panel > right click the style name> duplicate
Link to an existing CSS style sheet Open the HTML file CSS style panel>attach style sheet >browse>all media Attach style sheet button This is your .css file name.

More Related Content

What's hot (20)

Css
CssCss
Css
jayakarthi
 
Css intro
Css introCss intro
Css intro
Andz Bass
 
Css
CssCss
Css
MAGNA COLLEGE OF ENGINEERING
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2
Jeff Byrnes
 
CSS in HTML
CSS in HTMLCSS in HTML
CSS in HTML
Vineet Kumar Saini
 
chitra
chitrachitra
chitra
sweet chitra
 
Css
CssCss
Css
Venkat Krishnan
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
Randy Oest II
 
Css
CssCss
Css
Hemant Saini
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
Sanjeev Kumar
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
sanjay2211
 
html-css
html-csshtml-css
html-css
Dhirendra Chauhan
 
Css
CssCss
Css
Anuj Singh Rajput
 
Design Dream
Design DreamDesign Dream
Design Dream
IEEE UVPCE
 
Class6
Class6Class6
Class6
Jiyeon Lee
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Erin M. Kidwell
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
Tesfaye Yenealem
 
HTML Email
HTML EmailHTML Email
HTML Email
Shawn Calvert
 
Css
CssCss
Css
Mukesh Tekwani
 
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJSBasic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Deepak Upadhyay
 

Viewers also liked (20)

Week5 ap forms
Week5 ap formsWeek5 ap forms
Week5 ap forms
Rowena LI
 
Week7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image HotspotsWeek7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image Hotspots
Rowena LI
 
Week1 Dreamweaver and Server
Week1 Dreamweaver and ServerWeek1 Dreamweaver and Server
Week1 Dreamweaver and Server
Rowena LI
 
Social media as a widget
Social media as a widgetSocial media as a widget
Social media as a widget
Rowena LI
 
PHP
PHPPHP
PHP
Rowena LI
 
Web 2.0: its impact on library services
Web 2.0: its impact on library servicesWeb 2.0: its impact on library services
Web 2.0: its impact on library services
Rowena LI
 
Social and Mobile Media in the Librarian Profession
Social and Mobile Media in the Librarian ProfessionSocial and Mobile Media in the Librarian Profession
Social and Mobile Media in the Librarian Profession
Rowena LI
 
Hybrid in 5 minutes
Hybrid in 5 minutesHybrid in 5 minutes
Hybrid in 5 minutes
Rowena LI
 
Week 2 HTML lists, hyperlinks, tables, and images
Week 2 HTML lists, hyperlinks, tables, and imagesWeek 2 HTML lists, hyperlinks, tables, and images
Week 2 HTML lists, hyperlinks, tables, and images
Rowena LI
 
Week1 Introduction
Week1 IntroductionWeek1 Introduction
Week1 Introduction
Rowena LI
 
Week 2
Week 2Week 2
Week 2
Rowena LI
 
JavaScript
JavaScriptJavaScript
JavaScript
Rowena LI
 
Meet your 2014 Growth Engine: Subscription Revenues
Meet your 2014 Growth Engine:  Subscription RevenuesMeet your 2014 Growth Engine:  Subscription Revenues
Meet your 2014 Growth Engine: Subscription Revenues
ServiceSource
 
3 Findings that Can Get Your Customer Revenue Back on the Path to Growth [Inf...
3 Findings that Can Get Your Customer Revenue Back on the Path to Growth [Inf...3 Findings that Can Get Your Customer Revenue Back on the Path to Growth [Inf...
3 Findings that Can Get Your Customer Revenue Back on the Path to Growth [Inf...
ServiceSource
 
Customer success on salesforce platform dreamforce 2014
Customer success on salesforce platform dreamforce 2014Customer success on salesforce platform dreamforce 2014
Customer success on salesforce platform dreamforce 2014
ServiceSource
 
Find New Revenue with Existing Customers
Find New Revenue with Existing CustomersFind New Revenue with Existing Customers
Find New Revenue with Existing Customers
ServiceSource
 
Tribe Night Slidshare Presentation
Tribe Night Slidshare PresentationTribe Night Slidshare Presentation
Tribe Night Slidshare Presentation
Tribe Church
 
Dreamforce 2013 One Hit Wonder Sessions
Dreamforce 2013 One Hit Wonder SessionsDreamforce 2013 One Hit Wonder Sessions
Dreamforce 2013 One Hit Wonder Sessions
ServiceSource
 
Trabajo de majo
Trabajo de majoTrabajo de majo
Trabajo de majo
guest21a9f6
 
social work
social worksocial work
social work
guest21a9f6
 
Week5 ap forms
Week5 ap formsWeek5 ap forms
Week5 ap forms
Rowena LI
 
Week7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image HotspotsWeek7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image Hotspots
Rowena LI
 
Week1 Dreamweaver and Server
Week1 Dreamweaver and ServerWeek1 Dreamweaver and Server
Week1 Dreamweaver and Server
Rowena LI
 
Social media as a widget
Social media as a widgetSocial media as a widget
Social media as a widget
Rowena LI
 
Web 2.0: its impact on library services
Web 2.0: its impact on library servicesWeb 2.0: its impact on library services
Web 2.0: its impact on library services
Rowena LI
 
Social and Mobile Media in the Librarian Profession
Social and Mobile Media in the Librarian ProfessionSocial and Mobile Media in the Librarian Profession
Social and Mobile Media in the Librarian Profession
Rowena LI
 
Hybrid in 5 minutes
Hybrid in 5 minutesHybrid in 5 minutes
Hybrid in 5 minutes
Rowena LI
 
Week 2 HTML lists, hyperlinks, tables, and images
Week 2 HTML lists, hyperlinks, tables, and imagesWeek 2 HTML lists, hyperlinks, tables, and images
Week 2 HTML lists, hyperlinks, tables, and images
Rowena LI
 
Week1 Introduction
Week1 IntroductionWeek1 Introduction
Week1 Introduction
Rowena LI
 
Meet your 2014 Growth Engine: Subscription Revenues
Meet your 2014 Growth Engine:  Subscription RevenuesMeet your 2014 Growth Engine:  Subscription Revenues
Meet your 2014 Growth Engine: Subscription Revenues
ServiceSource
 
3 Findings that Can Get Your Customer Revenue Back on the Path to Growth [Inf...
3 Findings that Can Get Your Customer Revenue Back on the Path to Growth [Inf...3 Findings that Can Get Your Customer Revenue Back on the Path to Growth [Inf...
3 Findings that Can Get Your Customer Revenue Back on the Path to Growth [Inf...
ServiceSource
 
Customer success on salesforce platform dreamforce 2014
Customer success on salesforce platform dreamforce 2014Customer success on salesforce platform dreamforce 2014
Customer success on salesforce platform dreamforce 2014
ServiceSource
 
Find New Revenue with Existing Customers
Find New Revenue with Existing CustomersFind New Revenue with Existing Customers
Find New Revenue with Existing Customers
ServiceSource
 
Tribe Night Slidshare Presentation
Tribe Night Slidshare PresentationTribe Night Slidshare Presentation
Tribe Night Slidshare Presentation
Tribe Church
 
Dreamforce 2013 One Hit Wonder Sessions
Dreamforce 2013 One Hit Wonder SessionsDreamforce 2013 One Hit Wonder Sessions
Dreamforce 2013 One Hit Wonder Sessions
ServiceSource
 

Similar to Week3 css (20)

Introduction to Cascading Style Sheets
Introduction to Cascading Style SheetsIntroduction to Cascading Style Sheets
Introduction to Cascading Style Sheets
Tushar Joshi
 
CSS Part I
CSS Part ICSS Part I
CSS Part I
Doncho Minkov
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
CSS
CSSCSS
CSS
Deepa Lakshmi
 
CSS
CSSCSS
CSS
anandha ganesh
 
CSS
CSSCSS
CSS
BG Java EE Course
 
CSCADING style sheet. Internal external inline
CSCADING style sheet. Internal external inlineCSCADING style sheet. Internal external inline
CSCADING style sheet. Internal external inline
Ranjeet Reddy
 
css-ppt.pdf
css-ppt.pdfcss-ppt.pdf
css-ppt.pdf
EktaDesai14
 
cdocumentsandsettingsstudentdesktopnewfolderhtmlcss-100220030010-phpapp01.pdf
cdocumentsandsettingsstudentdesktopnewfolderhtmlcss-100220030010-phpapp01.pdfcdocumentsandsettingsstudentdesktopnewfolderhtmlcss-100220030010-phpapp01.pdf
cdocumentsandsettingsstudentdesktopnewfolderhtmlcss-100220030010-phpapp01.pdf
hinalsomani93
 
AK css
AK cssAK css
AK css
gauravashq
 
CSS 101
CSS 101CSS 101
CSS 101
dunclair
 
Css
CssCss
Css
NIRMAL FELIX
 
Full
FullFull
Full
sanjaykhan33
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
Hatem Mahmoud
 
Cascstylesheets
CascstylesheetsCascstylesheets
Cascstylesheets
Digital Insights - Digital Marketing Agency
 
css.ppt
css.pptcss.ppt
css.ppt
SchoolEducationDepar
 
Css
CssCss
Css
Yudha Arif Budiman
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
PushpaLatha551681
 
ch04-css-basics_final.ppt
ch04-css-basics_final.pptch04-css-basics_final.ppt
ch04-css-basics_final.ppt
GmachImen
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
elayelily
 

Recently uploaded (20)

Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted RegressionKNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
Global Academy of Technology
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
Policies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptxPolicies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptx
mansk2
 
QUIZ-O-FORCE PRELIMINARY ANSWER SLIDE.pptx
QUIZ-O-FORCE PRELIMINARY ANSWER SLIDE.pptxQUIZ-O-FORCE PRELIMINARY ANSWER SLIDE.pptx
QUIZ-O-FORCE PRELIMINARY ANSWER SLIDE.pptx
Sourav Kr Podder
 
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Sandeep Swamy
 
THE FEMALE POPE IN SAINT PETER'S BASILICA
THE FEMALE POPE IN SAINT PETER'S BASILICATHE FEMALE POPE IN SAINT PETER'S BASILICA
THE FEMALE POPE IN SAINT PETER'S BASILICA
Claude LaCombe
 
Drug Metabolism advanced medicinal chemistry.pptx
Drug Metabolism advanced medicinal chemistry.pptxDrug Metabolism advanced medicinal chemistry.pptx
Drug Metabolism advanced medicinal chemistry.pptx
pharmaworld
 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
siemaillard
 
Decision Tree-ID3,C4.5,CART,Regression Tree
Decision Tree-ID3,C4.5,CART,Regression TreeDecision Tree-ID3,C4.5,CART,Regression Tree
Decision Tree-ID3,C4.5,CART,Regression Tree
Global Academy of Technology
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdfUnit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
ChatanBawankar
 
How to create and manage blogs in odoo 18
How to create and manage blogs in odoo 18How to create and manage blogs in odoo 18
How to create and manage blogs in odoo 18
Celine George
 
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
Julián Jesús Pérez Fernández
 
Protest - Student Revision Booklet For VCE English
Protest - Student Revision Booklet For VCE EnglishProtest - Student Revision Booklet For VCE English
Protest - Student Revision Booklet For VCE English
jpinnuck
 
Low Vison introduction from Aligarh Muslim University
Low Vison introduction from Aligarh Muslim UniversityLow Vison introduction from Aligarh Muslim University
Low Vison introduction from Aligarh Muslim University
Aligarh Muslim University, Aligarh, Uttar Pradesh, India
 
How to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 ManufacturingHow to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 Manufacturing
Celine George
 
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Ibrahim Tareq
 
EVALUATION AND MANAGEMENT OF OPEN FRACTURE
EVALUATION AND MANAGEMENT OF OPEN FRACTUREEVALUATION AND MANAGEMENT OF OPEN FRACTURE
EVALUATION AND MANAGEMENT OF OPEN FRACTURE
BipulBorthakur
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted RegressionKNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
Global Academy of Technology
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
Policies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptxPolicies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptx
mansk2
 
QUIZ-O-FORCE PRELIMINARY ANSWER SLIDE.pptx
QUIZ-O-FORCE PRELIMINARY ANSWER SLIDE.pptxQUIZ-O-FORCE PRELIMINARY ANSWER SLIDE.pptx
QUIZ-O-FORCE PRELIMINARY ANSWER SLIDE.pptx
Sourav Kr Podder
 
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Sandeep Swamy
 
THE FEMALE POPE IN SAINT PETER'S BASILICA
THE FEMALE POPE IN SAINT PETER'S BASILICATHE FEMALE POPE IN SAINT PETER'S BASILICA
THE FEMALE POPE IN SAINT PETER'S BASILICA
Claude LaCombe
 
Drug Metabolism advanced medicinal chemistry.pptx
Drug Metabolism advanced medicinal chemistry.pptxDrug Metabolism advanced medicinal chemistry.pptx
Drug Metabolism advanced medicinal chemistry.pptx
pharmaworld
 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
siemaillard
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdfUnit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
Unit 1 Tools Beneficial for Monitoring the Debugging Process.pdf
ChatanBawankar
 
How to create and manage blogs in odoo 18
How to create and manage blogs in odoo 18How to create and manage blogs in odoo 18
How to create and manage blogs in odoo 18
Celine George
 
Protest - Student Revision Booklet For VCE English
Protest - Student Revision Booklet For VCE EnglishProtest - Student Revision Booklet For VCE English
Protest - Student Revision Booklet For VCE English
jpinnuck
 
How to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 ManufacturingHow to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 Manufacturing
Celine George
 
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Patent Law in Bangladesh Addressing Challenges in Pharmaceutical Innovation a...
Ibrahim Tareq
 
EVALUATION AND MANAGEMENT OF OPEN FRACTURE
EVALUATION AND MANAGEMENT OF OPEN FRACTUREEVALUATION AND MANAGEMENT OF OPEN FRACTURE
EVALUATION AND MANAGEMENT OF OPEN FRACTURE
BipulBorthakur
 

Week3 css

  • 2. CSS - what? Cascade Style Sheets Defines how to display HTML elements (fonts, size, colors, background images, border, styles) Add to HTML 4.0 Stored in CSS files All browsers support CSS Defined by the World Wide Web consortium (W3C) CSS Website Example http:// www.csszengarden.com /
  • 3. CSS - why??? Advantages Saves time editing (define once on the element, next time the elements will automatically defined) Page load faster Easy maintenance Superior styles to HTML (much wider array of attributes) Disadvantage Browser compatibility
  • 4. syntax A CSS rule has two main parts: a selector, and one or more declarations The selector is 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.
  • 5. how to ?? Text editors Notepad/WordPad for Windows; TextEdit for Mac Dreamweaver has a function embedded into the program. Comments /* This is for CSS. */ Grouping h1, h2, h3 {color: blue;} Applying multiple properties h1 {color: blue; font-size: 150%; font-family: arial, Helvetica, “sans serif”; }
  • 6. inline and internal styles <html> <head> <title>Project One</title> </head> < body > <p > This is a red page. </p> </body> </html> <style type=&quot;text/css&quot;> body {background-color: #ff0000;} p {color: blue; margin-left:20px;} </style> style=&quot;background-color: #ff0000;&quot; style=&quot;color:blue;margin-left:20px ;&quot;
  • 7. external style (1) Create a text file and save as .css Create a link in HTML document The css style sheet contains only styles
  • 8. external style – where to put it?
  • 9. p{margin-left:20px;} body{background-color:#ff0000;} external style – how to write it? mystyle.css project.html <html> <head> <title>Project One</title> <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=“mystyle.css&quot; /> </head> <body> ...
  • 10. cascade order Styles can be specified: Inside an HTML element (in-line) Inside the head section of an HTML page (internal) In an external CSS style sheet (external) All the styles will cascade into a new style sheet by the following rules, where number 1 has the highest priority: inline style internal style external style browser default
  • 11. CSS code reference Text Color body {color:blue} h1 {color:#00ff00} h2 {color:rgb(255,0,0)} Text Alignment h1 {text-align:center} p.date {text-align:right} p.main {text-align:justify} Text Decoration h1 {text-decoration:overline} h2 {text-decoration:line-through} h3 {text-decoration:underline} h4 {text-decoration:blink}
  • 12. CSS code reference font p { font-style: italic; font-weight: bold; font-size: 30px; font-family: arial, sans-serif;} Using the short hand property, the code can be simplified: p { font: italic bold 30px arial, sans-serif; }
  • 13. CSS code reference link a:link {color: blue;} (unvisited link) a:visited {color: red;} a:active {background-color: #ffff00;} (active link) a:hover {color: orange; font-style: italic; letter-spacing: 10px; font-weight:bold; text-transform: uppercase; background-color:yellow;}
  • 14. 4 selector types Tag: re-define an existing HTML element ID: applies to only one HTML element Class: applies to any HTML element Compound: used to combine two or more style rules to create a style definition that displays only when one style is contained within another. Read: CSS selectors: tags, ID, class and compound
  • 15. tag
  • 16. ID #id 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 &quot;#&quot;. <html> <head> <style type=&quot;text/css&quot;> #para1 {text-align:center; color:red;} </style> </head> <body> <p id=&quot;para1&quot; >Hello World!</p> <p>This paragraph is not affected.</p> </body> </html> Hello World! This paragraph is not affected. P P P P
  • 17. CLASS .classname used to specify a style for different elements. allows you to set a particular style for any html elements with the same class. uses the html class attribute, and is defined with a &quot;.&quot; P h1 h4 h2
  • 18. CLASS (example) <html> <head> <style type=&quot;text/css&quot;> .center{text-align:center;} </style> </head> <body> <h1 class=&quot;center&quot; >center-aligned heading</h1> <p class=&quot;center&quot; >center-aligned paragraph.</p> /body> </html> center-aligned heading center-aligned paragraph.
  • 19. recap 3 places inline internal style (between <head></head>) external style (save as .css, html links in the head section) Selectors tag style (applies globally to an individual HTML tag) Id style (format a unique item on a page) class style (format more than 1 item at the same time) compound style
  • 20. Set up the working space Click Window tab > click CSS style to open CSS panel On Properties panel, choose CSS tab
  • 21. create a new CSS style CSS style panel highlight the text or image or table + add new CSS rule >selector (class, id, tag, or compound) name internal or external or defined .css file define elements Properties Panel click CSS mode highlight the text or image targeted rule: new CSS rule>edit rule> open a window > choose the appropriate selector - class, id, tag, or compound > name it define the elements
  • 22. apply existing styles Properties Panel For non-text elements, find class button and click the arrow, choose the existing class from the list; For text elements, click CSS mode> targeted rule , choose the existing class from the list.
  • 23. remove a style Property panel: <HTML> mode >class>none or <CSS> mode> targeted rule>remove class ** It only remove the style form the item, but the class is still there.
  • 24. style, style, more style Edit Styles Find the rule in CSS panel Click on it Change it in the window Rename a class style Properties Panel > class menu>rename or Right click the rule in CSS panel Duplicate a style CSS style panel > right click the style name> duplicate
  • 25. Link to an existing CSS style sheet Open the HTML file CSS style panel>attach style sheet >browse>all media Attach style sheet button This is your .css file name.