SlideShare une entreprise Scribd logo
1  sur  32
 
Basics By Gopinath Ambothi CSS
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Index
What is CSS? ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],Why CSS?
<link rel=“stylesheet”type=“text/css”href=“style.css”/> HTML<html><head>  <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=“style.css&quot; /> </head>…</html> … … … … style.css … … … … … sample.html Reference CSS from HTML
CSS Syntax h1 { color: red; background: yellow; } Selector Style Block Element Properties Style Values •  The  Selector  selects elements on the HTML page. •  The associated  Style Block  applies its  Style Values  to the selected  Element’s Properties
[object Object],[object Object],[object Object],[object Object],ID and Class The ‘ID’ Selector In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called &quot;id&quot; and &quot;class&quot;.
[object Object],[object Object],[object Object],[object Object],[object Object],ID and Class The ‘Class’ Selector
Selectors Select elements to apply a declared style. • Selector types: – Element Selectors:  selects  all  elements of a specific  type  (<body>, <h1>, <p>, etc.) – Class Selectors:  selects  all  elements that belong to a given  class. – ID Selectors:  selects a  single  element that’s been given a  unique id . – Pseudo Selectors:  combines a selector with a  user activated state  (:hover, :link, :visited)
Selectors Element Selectors • Finds  all  HTML elements that have the specified  element type . • Example: h1{ color: blue; } Finds  all elements of type < h1 > and makes the text color blue.
Selectors Class Selectors • Finds  all  elements of a given class –based on the attribute’s  class value . • Syntax:  .classname  (Remember the dot means class selector) • Example:  .legs{ font-weight: bold; background: pink; } Finds  all  elements whose class = “ legs ” and makes their font bold and their backgrounds pink.
Selectors ID Selectors • Finds  a single  element that’s been given a  unique id –based on the attribute’s  id value . • Syntax:  #idname  (Remember the pound-sign means id selector) • Example:  #snout{ border: solid red; } Finds  a single element  whose id = “ snout ” and gives it a solid red border.
Selectors Pseudo Selectors Apply styles to a  user activated state  of an element. • If used, must be declared in a  specific order  in the style sheet. • General Purpose Pseudo-Selector: – :hover  Element with mouse over • Specific to hyperlinks (and/or buttons) – a:active  A link or button that is currently being  clicked  on. – a:link  A link that has  NOT been visited yet. – a:visited  A link that  HAS been visited.
Grouping Selectors • Lets say you want to apply the same style to several different selectors.  Don’t repeat  the style – use a comma !! • Syntax:  sel1, sel2, sel3  (Remember the comma to group several different selectors) • Example:  h1, .legs, #snout{ font-size: 20pt; } Finds all elements of type < h1 >, all elements with class=“ legs ” and the single element whose id = “ snout ” then makes their font-size 20pt.
Conflict Resolution • It’s possible to have  different  styles applied to the  same  selector ( C ascading SS ), but what if the styles tell the browser to do  conflicting  things? • Rules: – Which selector is more  specific ? – If the selectors are the same, then which style was applied  last ?
Sharpen your Selector • Order of specificity:  (specific)  id ,  class ,  elementtype  (ambiguous) • Combine selectors: Elementype.classname or Elementype#idname e.g. p.legs   [ or]  h2#snout
Sharpen your Selector • Descendant Selectors: Specify the context in the HTML tree from each ancestor down to the desired element –each separated by a space. e.g. body.pigp.pig-head #snout • HTML Tree: <body class=“pig”> <p class=“pig-head”> <h1 id=“snout”> Snout SnoutSnout </h1> </p> </body>
Basic CSS Tags & Properties
<span> Element Tag • Useful for applying style to text within another HTML element. • Use  SPARINGLY –unlike <h1> or <p>, <span> has no semantic meaning. • Remember, HTML is for content and HTML tags are for describing that content to non-human or visually-impaired readers. <span> is just used to make things “pretty.”
<div> Element Tag • Useful for dividing parts of the page into sections. • Creates a “box” with the following attributes: – margin – padding – border – height – width – (..and lots more) • Primary element used for CSS Layouts
Color Properties color:  specifies the text color. background-color:  specifies the background color. black; or #000000; red; or #FF0000; lime; or #00FF00; blue; or #0000FF; white; or #000000; … and more
Background Image Properties background-image: url(../location/of/image.jpg) background-repeat: tile image in background background-position: vertical(top, center, bottom, or size) horizontal(left, center, right, or size) background-attachment : (scrollor fixed)
Font Properties font-family: times, arial, serif, sans-serif, monospace; font-style: italic; font-weight: ( bold ,  bolder , lighter, or 100 – 900;) font-size: size; … or shorthand font: style weight size family;
Text Properties text-indent: indents first line of a paragraph according to size text-align: right;or left;or center;or justify; text-decoration:  none; orunderline; text-transform: Capitalize; Line-height: added vertical space to each line of text according to size
List Properties list-style-type: none, disc, circle, square,(other types available)  list-style-position : inside or outside list-style-image: url(../path/to/image.jpg) … or shorthand list-style: type position image
Border Properties border-width: (thin, medium, thick, or size) border-style: (none, hidden, dotted, dashed, solid, double, groove, ridge, inset, or outset)  border-color: color … or shorthand border(-top, -right, -left, -bottom): width style color
Position Properties Absolute  - The box is placed in an absolute location relative to the container block. The element's position is specified with the &quot;left&quot;, &quot;top&quot;, &quot;right&quot;, and &quot;bottom&quot; properties Fixed  - Generates an absolutely positioned element, positioned relative to the browser window. The element's position is specified with the &quot;left&quot;, &quot;top&quot;, &quot;right&quot;, and &quot;bottom&quot; properties Relative  - Generates a relatively positioned element, positioned relative to its normal position, so &quot;left:20&quot; adds 20 pixels to the element's LEFT position Static  - Default. No position, the element occurs in the normal flow (ignores any top, bottom, left, right, or z-index declarations) Inherit  - The element should have the same position value as the parent element. Example:  http://www.w3schools.com/Css/tryit.asp?filename= trycss_position_relative
Float Properties With CSS float, an element can be pushed to the  Left   or   Right   allowing other elements to wrap around it. Float is very often used for images, but it is also useful when working with layouts. How Elements Float? Elements are floated horizontally, this means that an element can only be floated left or right, not up or down. A floated element will move as far to the left or right as it can. Usually this means all the way to the left or right of the containing element. The elements after the floating element will flow around it. The elements before the floating element will not be affected.
CSS Box Model The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content. The box model allows us to place a border around elements and space elements in relation to other elements. The image below illustrates the box model:
Use Firebug / IE developer tool bar  ,[object Object],[object Object],[object Object],[object Object]
Thank You!

Contenu connexe

Tendances (20)

Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
 
Css ppt
Css pptCss ppt
Css ppt
 
Css lecture notes
Css lecture notesCss lecture notes
Css lecture notes
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 
CSS
CSSCSS
CSS
 
CSS
CSS CSS
CSS
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Css.html
Css.htmlCss.html
Css.html
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Web front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptWeb front end development introduction to html css and javascript
Web front end development introduction to html css and javascript
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
 
Cascading style sheet
Cascading style sheetCascading style sheet
Cascading style sheet
 
Css
CssCss
Css
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
Html
HtmlHtml
Html
 
CSS
CSSCSS
CSS
 

En vedette

[전파교육] css day 2014
[전파교육] css day 2014[전파교육] css day 2014
[전파교육] css day 2014Kyoung Hwan Min
 
javascript3
javascript3javascript3
javascript3osman do
 
Java script introducation & basics
Java script introducation & basicsJava script introducation & basics
Java script introducation & basicsH K
 
[Basic HTML/CSS] 6. css - box sizing, display, margin, padding
[Basic HTML/CSS] 6. css - box sizing, display, margin, padding[Basic HTML/CSS] 6. css - box sizing, display, margin, padding
[Basic HTML/CSS] 6. css - box sizing, display, margin, paddingHyejin Oh
 
[CSS Drawing] Basic Tutorial (라이언 그리기)
[CSS Drawing] Basic Tutorial (라이언 그리기)[CSS Drawing] Basic Tutorial (라이언 그리기)
[CSS Drawing] Basic Tutorial (라이언 그리기)Hyejin Oh
 
[Basic HTML/CSS] 7. project
[Basic HTML/CSS] 7. project[Basic HTML/CSS] 7. project
[Basic HTML/CSS] 7. projectHyejin Oh
 
PROGRESS - CSS BASIC
PROGRESS - CSS BASICPROGRESS - CSS BASIC
PROGRESS - CSS BASICUKM PROGRESS
 
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]Aaron Gustafson
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML FormNosheen Qamar
 
[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tagsHyejin Oh
 
[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tagsHyejin Oh
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notesRex Wang
 

En vedette (20)

[전파교육] css day 2014
[전파교육] css day 2014[전파교육] css day 2014
[전파교육] css day 2014
 
CSS3
CSS3CSS3
CSS3
 
CSS
CSSCSS
CSS
 
javascript3
javascript3javascript3
javascript3
 
Java script introducation & basics
Java script introducation & basicsJava script introducation & basics
Java script introducation & basics
 
[Basic HTML/CSS] 6. css - box sizing, display, margin, padding
[Basic HTML/CSS] 6. css - box sizing, display, margin, padding[Basic HTML/CSS] 6. css - box sizing, display, margin, padding
[Basic HTML/CSS] 6. css - box sizing, display, margin, padding
 
[CSS Drawing] Basic Tutorial (라이언 그리기)
[CSS Drawing] Basic Tutorial (라이언 그리기)[CSS Drawing] Basic Tutorial (라이언 그리기)
[CSS Drawing] Basic Tutorial (라이언 그리기)
 
CSS font-stacks
CSS font-stacksCSS font-stacks
CSS font-stacks
 
[Basic HTML/CSS] 7. project
[Basic HTML/CSS] 7. project[Basic HTML/CSS] 7. project
[Basic HTML/CSS] 7. project
 
PROGRESS - CSS BASIC
PROGRESS - CSS BASICPROGRESS - CSS BASIC
PROGRESS - CSS BASIC
 
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
 
HTML Dasar : #10 Form
HTML Dasar : #10 FormHTML Dasar : #10 Form
HTML Dasar : #10 Form
 
[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags
 
[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags
 
Basic css-tutorial
Basic css-tutorialBasic css-tutorial
Basic css-tutorial
 
Java script basic
Java script basicJava script basic
Java script basic
 
Color For Dummies
Color For DummiesColor For Dummies
Color For Dummies
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notes
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 

Similaire à Basic css

Similaire à Basic css (20)

Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
CSS
CSSCSS
CSS
 
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
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
 
Css
CssCss
Css
 
CSS
CSSCSS
CSS
 
Css
CssCss
Css
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
 
Intro to html, css & sass
Intro to html, css & sassIntro to html, css & sass
Intro to html, css & sass
 
Css basics
Css basicsCss basics
Css basics
 
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptx
 
CSS Introduction
CSS Introduction CSS Introduction
CSS Introduction
 
Css from scratch
Css from scratchCss from scratch
Css from scratch
 
CSS-part-1.ppt
CSS-part-1.pptCSS-part-1.ppt
CSS-part-1.ppt
 
CSS
CSSCSS
CSS
 
Web Programming& Scripting Lab
Web Programming& Scripting LabWeb Programming& Scripting Lab
Web Programming& Scripting Lab
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
Understanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaUnderstanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company india
 
css v1 guru
css v1 gurucss v1 guru
css v1 guru
 

Dernier

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 

Dernier (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 

Basic css

  • 1.  
  • 2. Basics By Gopinath Ambothi CSS
  • 3.
  • 4.
  • 5.
  • 6. <link rel=“stylesheet”type=“text/css”href=“style.css”/> HTML<html><head> <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=“style.css&quot; /> </head>…</html> … … … … style.css … … … … … sample.html Reference CSS from HTML
  • 7. CSS Syntax h1 { color: red; background: yellow; } Selector Style Block Element Properties Style Values • The Selector selects elements on the HTML page. • The associated Style Block applies its Style Values to the selected Element’s Properties
  • 8.
  • 9.
  • 10. Selectors Select elements to apply a declared style. • Selector types: – Element Selectors: selects all elements of a specific type (<body>, <h1>, <p>, etc.) – Class Selectors: selects all elements that belong to a given class. – ID Selectors: selects a single element that’s been given a unique id . – Pseudo Selectors: combines a selector with a user activated state (:hover, :link, :visited)
  • 11. Selectors Element Selectors • Finds all HTML elements that have the specified element type . • Example: h1{ color: blue; } Finds all elements of type < h1 > and makes the text color blue.
  • 12. Selectors Class Selectors • Finds all elements of a given class –based on the attribute’s class value . • Syntax: .classname (Remember the dot means class selector) • Example: .legs{ font-weight: bold; background: pink; } Finds all elements whose class = “ legs ” and makes their font bold and their backgrounds pink.
  • 13. Selectors ID Selectors • Finds a single element that’s been given a unique id –based on the attribute’s id value . • Syntax: #idname (Remember the pound-sign means id selector) • Example: #snout{ border: solid red; } Finds a single element whose id = “ snout ” and gives it a solid red border.
  • 14. Selectors Pseudo Selectors Apply styles to a user activated state of an element. • If used, must be declared in a specific order in the style sheet. • General Purpose Pseudo-Selector: – :hover Element with mouse over • Specific to hyperlinks (and/or buttons) – a:active A link or button that is currently being clicked on. – a:link A link that has NOT been visited yet. – a:visited A link that HAS been visited.
  • 15. Grouping Selectors • Lets say you want to apply the same style to several different selectors. Don’t repeat the style – use a comma !! • Syntax: sel1, sel2, sel3 (Remember the comma to group several different selectors) • Example: h1, .legs, #snout{ font-size: 20pt; } Finds all elements of type < h1 >, all elements with class=“ legs ” and the single element whose id = “ snout ” then makes their font-size 20pt.
  • 16. Conflict Resolution • It’s possible to have different styles applied to the same selector ( C ascading SS ), but what if the styles tell the browser to do conflicting things? • Rules: – Which selector is more specific ? – If the selectors are the same, then which style was applied last ?
  • 17. Sharpen your Selector • Order of specificity: (specific) id , class , elementtype (ambiguous) • Combine selectors: Elementype.classname or Elementype#idname e.g. p.legs [ or] h2#snout
  • 18. Sharpen your Selector • Descendant Selectors: Specify the context in the HTML tree from each ancestor down to the desired element –each separated by a space. e.g. body.pigp.pig-head #snout • HTML Tree: <body class=“pig”> <p class=“pig-head”> <h1 id=“snout”> Snout SnoutSnout </h1> </p> </body>
  • 19. Basic CSS Tags & Properties
  • 20. <span> Element Tag • Useful for applying style to text within another HTML element. • Use SPARINGLY –unlike <h1> or <p>, <span> has no semantic meaning. • Remember, HTML is for content and HTML tags are for describing that content to non-human or visually-impaired readers. <span> is just used to make things “pretty.”
  • 21. <div> Element Tag • Useful for dividing parts of the page into sections. • Creates a “box” with the following attributes: – margin – padding – border – height – width – (..and lots more) • Primary element used for CSS Layouts
  • 22. Color Properties color: specifies the text color. background-color: specifies the background color. black; or #000000; red; or #FF0000; lime; or #00FF00; blue; or #0000FF; white; or #000000; … and more
  • 23. Background Image Properties background-image: url(../location/of/image.jpg) background-repeat: tile image in background background-position: vertical(top, center, bottom, or size) horizontal(left, center, right, or size) background-attachment : (scrollor fixed)
  • 24. Font Properties font-family: times, arial, serif, sans-serif, monospace; font-style: italic; font-weight: ( bold , bolder , lighter, or 100 – 900;) font-size: size; … or shorthand font: style weight size family;
  • 25. Text Properties text-indent: indents first line of a paragraph according to size text-align: right;or left;or center;or justify; text-decoration: none; orunderline; text-transform: Capitalize; Line-height: added vertical space to each line of text according to size
  • 26. List Properties list-style-type: none, disc, circle, square,(other types available) list-style-position : inside or outside list-style-image: url(../path/to/image.jpg) … or shorthand list-style: type position image
  • 27. Border Properties border-width: (thin, medium, thick, or size) border-style: (none, hidden, dotted, dashed, solid, double, groove, ridge, inset, or outset) border-color: color … or shorthand border(-top, -right, -left, -bottom): width style color
  • 28. Position Properties Absolute - The box is placed in an absolute location relative to the container block. The element's position is specified with the &quot;left&quot;, &quot;top&quot;, &quot;right&quot;, and &quot;bottom&quot; properties Fixed - Generates an absolutely positioned element, positioned relative to the browser window. The element's position is specified with the &quot;left&quot;, &quot;top&quot;, &quot;right&quot;, and &quot;bottom&quot; properties Relative - Generates a relatively positioned element, positioned relative to its normal position, so &quot;left:20&quot; adds 20 pixels to the element's LEFT position Static - Default. No position, the element occurs in the normal flow (ignores any top, bottom, left, right, or z-index declarations) Inherit - The element should have the same position value as the parent element. Example: http://www.w3schools.com/Css/tryit.asp?filename= trycss_position_relative
  • 29. Float Properties With CSS float, an element can be pushed to the Left or Right allowing other elements to wrap around it. Float is very often used for images, but it is also useful when working with layouts. How Elements Float? Elements are floated horizontally, this means that an element can only be floated left or right, not up or down. A floated element will move as far to the left or right as it can. Usually this means all the way to the left or right of the containing element. The elements after the floating element will flow around it. The elements before the floating element will not be affected.
  • 30. CSS Box Model The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content. The box model allows us to place a border around elements and space elements in relation to other elements. The image below illustrates the box model:
  • 31.