SlideShare a Scribd company logo
1 of 40
CSS Presentation

Doncho Minkov
Technical Trainer
http://minkov.it
Telerik Web Design Course
html5course.telerik.com
Table of Contents

 Borders

 Overflow

 Margins and Paddings

 The Box Model

 Width and Height

 Other CSS Properties




                                             2
Borders
Borders
 border-width: thin, medium, thick or

 numerical value (e.g. 10px)
 border-color: color alias or RGB value

 border-style: none, hidden, dotted,

 dashed, solid, double, groove, ridge,
 inset, outset
 Each property can be defined separately for

 left, top, bottom and right
   border-top-style, border-left-color, …
                                                4
Border Shorthand Property
 border: shorthand rule for setting border

 properties at once:
  border: 1px solid red

 is equal to writing:
  border-width:1px;
  border-color:red;
  border-style:solid;

 Specify different borders for the sides via

 shorthand rules: border-top, border-left,
 border-right, border-bottom
 When to avoid border:0                        5
Borders
   Live Demo
border-rules.html
Rounded Corners
Rounded Corners
 Rounded corners are actually a part of CSS 3

   Supported in all major browsers
   Firefox, IE 9, Chrome, Opera and Safari
 Done by the border-radius property

 border-radius: [<length>|<%>][<length>|<%>]?
 Three ways to define corner radius:

 border-radius: 15px;
 border-radius: 15px 15px 15px 10px;
 border-radius: 15px 20px;
Rounded Corners
    Live Demo
Overflow
Overflow
   overflow: defines the behavior of element when
    content needs more space than you have specified by
    the size properties or for other reasons. Values:
      visible (default) – content spills out of the
       element
      auto - show scrollbars if needed
     scroll – always show scrollbars
     hidden – any content that cannot fit is clipped



                                                          11
Overflow
    Live Demo
overflow-rule.html
Margins and Paddings
Margin and Padding
 margin and padding define the spacing
 around the element
  Numerical value, e.g. 10px or -5px
  Can be defined for each of the four sides
   separately - margin-top, padding-left, …
  margin is the spacing outside of the border
  padding is the spacing between the border and
   the content
  What are collapsing margins?

                                                   14
Margin and Padding: Short Rules
 margin:   5px;
  Sets all four sides to have margin of 5 px;
 margin:   10px 20px;
  top and bottom to 10px, left and right to 20px;
 margin:   5px 3px 8px;
  top 5px, left/right 3px, bottom 8px
 margin:   1px 3px 5px 7px;
  top, right, bottom, left (clockwise from top)
 Same for padding
                                                     15
Margins and Paddings
         Live Demo
 margins-paddings-rules.html
The Box Model
Margin
Border
Padding


Content




                          17
IE Quirks Mode
   When using quirks
    mode (pages with no
    DOCTYPE or with a
    HTML 4 Transitional
    DOCTYPE)


     Internet Explorer
     violates the box
     model standard!



                                       18
H
        e
            H
        i
        g   e
        h
Width   t   i
            g
            h
Width       t
Width and Height
 width – defines numerical value for the width
 of element, e.g. 200px
 height – defines numerical value for the
 height of element, e.g. 100px
   By default the height of an element is defined
    by its content
   Inline elements do not apply height, unless you
    change their display style



                                                      20
Width and Height
     Live Demo
   size-rules.html
List Styles
For Ordered and Unordered Lists
Styles for Lists
 List properties are used to define the look and
 feel of the list items
   Mainly to change the list item marker
 Normal styles:

   List-style-type
       Values for <ol>: circle, square,…
       Values for <ul>: upper-roman, lower-alpha
       Values for both: none
  ul
  {
       list-style-type:none;
  }
List Styles
  Live Demo
Images as Bullets
 We can set a image for the bullets of a list

   With the property list-style-image
 ul
 {
      list-style-image: url('images/blue-dot.jpg');
 }

   Does not work equally for all browsers
   IE puts less space between the bullet and the
    content
 Shorthand property
 ul
 {
      list-style: bullet url('images/blue-dot.jpg');
 }
Images as Bullets - Alternative
 We can place a background in the left-most

   It looks like a image-bullet
   ul
   {
        list-style-type: none;
        padding: 0px;
        margin: 0px;
   }
   li
   {
        background-image: url("images/blue-dot.png");
        background-repeat: no-repeat;
        background-position: 0px 5px;
        padding-left: 14px;
   }
Styles for List Tags
      Live Demo
Creating a Menu-like List
         In 5 minutes
Creating a Menu-like List
 What a menu has?

   Some buttons that are arranged from right to
    left
   We need to make it extensible
 Create a list

   Adding new list item is easy
   No worries when disabling the styles
Creating a Menu-like List
ul.menu
{
   list-style-type: none;
   padding: 0px;
   margin: 0px;
}
li.menu-item
{                             Menu-example
   float: left;
   margin: 10px;
}




                                             30
Creating a Menu-like List
         Live Demo
Other CSS Properties
Other CSS Properties
 cursor:specifies the look of the mouse cursor
 when placed over the element
   Values: crosshair, help, pointer,
    progress, move, hair, col-resize, row-
    resize, text, wait, copy, drop, and others
 white-space – controls the line breaking of
 text. Value is one of:
   nowrap – keeps the text on one line
   normal (default) – browser decides whether to
    brake the lines if needed
                                                    33
Other CSS Properties
       Live Demo
Maintenance Example

                                                                                          Title                                                                                                     Title
                                                                                            Some random                     Title                                                                       Some random
                           Title                                                            text here. You                  Some random                                                                 text here. You
                                                                            Title           can’t read it                   text here. You                          Title                               can’t read it
                            Some random
                                                                                            anyway! Har har                 can’t read it                                                               anyway! Har har
        Title               text here. You          Title                   Some random har! Use Css.                                                               Some random
                                                                                                                            anyway! Har har                                                             har! Use Css.
                            can’t read it                                   text here. You                                                                          text here. You
        Some random                                 Some random                                                             har! Use Css.
                            anyway! Har har                                 can’t read it                                                                           can’t read it
        text here. You                              text here. You                                          Title
                            har! Use Css.                                   anyway! Har har                                                                         anyway! Har har
        can’t read it                               can’t read it                                                                       Title                                       Title
                                                                            har! Use Css.                   Some random                                             har! Use Css.
        anyway! Har har                             anyway! Har har
                                                                                                            text here. You              Some random                                 Some random
        har! Use Css.                               har! Use Css.
                                                                                                            can’t read it               text here. You                              text here. You              Title
                                                                                                            anyway! Har har             can’t read it                               can’t read it
Title                                                                                                                                                                                                           Some random
                                                                                                            har! Use Css.               anyway! Har har                             anyway! Har har
Some random                                                     Title               Title                                                                           Title                                       text here. You
                                                                                                                                        har! Use Css.                               har! Use Css.
text here. You                      Title                                                                                                                                                                       can’t read it
                                                                Some random         Some random                                                                     Some random
can’t read it                                                                                                                                                                                                   anyway! Har har
                                    Some random                 text here. You      text here. You                  Title                                           text here. You
anyway! Har har                                                                                                                                                                                                 har! Use Css.
                                    text here. You              can’t read it       can’t read it                                                                   can’t read it               Title
har! Use Css.                                                                                                       Some random
                                    can’t read it               anyway! Har har anyway! Har har                                                                     anyway! Har har
                                                                                                                    text here. You          Title                                               Some random
                                    anyway! Har har             har! Use Css.       har! Use Css.                                                                   har! Use Css.
                    Title           har! Use Css.       Title                                                       can’t read it                                                               text here. You
                                                                                                                                            Some random
                                                                                                                    anyway! Har har                                                             can’t read it
                    Some random                         Some random                             Title                                       text here. You
                                                                                                                    har! Use Css.                                                               anyway! Har har
                    text here. You                      text here. You                                                                      can’t read it
                                                                                                Some random                                                                                     har! Use Css.
                    can’t read it                       can’t read it                                                                       anyway! Har har
                                                                                                text here. You
                    anyway! Har har                     anyway! Har har                                                                     har! Use Css.
                                                                Title                           can’t read it                                       Title
                    har! Use Css.                       har! Use Css.                           anyway! Har har
                                                                Some random                     har! Use Css.                                       Some random




                                                                                                                                                                                                                                  CSS
Title                                                           text here. You                                                                      text here. You                                  Title
                                Title                           can’t read it                                                                       can’t read it
Some random                                                                                                                                                                                         Some random
                                                                anyway! Har har                                                                     anyway! Har har
text here. You                  Some random                                                         Title                       Title                                   Title                       text here. You
                                                                har! Use Css.                                                                       har! Use Css.
can’t read it                   text here. You                                                                                                                                                      can’t read it
                                                                                                    Some random                 Some random                             Some random
anyway! Har har                 can’t read it                                                                                                                                                       anyway! Har har
                                                            Title                                   text here. You              text here. You                          text here. You
har! Use Css.                   anyway! Har har                                                                                                                                                     har! Use Css.
                                                                                                    can’t read it               can’t read it                           can’t read it
                                har! Use Css.               Some random
                                                                                                    anyway! Har har             anyway! Har har                         anyway! Har har
                                                            text here. You Title                                                                                                            Title




                                                                                                                                                                                                                                  file
                                                                                                    har! Use Css.               har! Use Css.                           har! Use Css.
                                                            can’t read it
                                                                            Some random                                                                                                     Some random
                                                            anyway! Har har
                                        Title                               text here. You                  Title                               Title                                       text here. You
                                                            har! Use Css.
                                                                            can’t read it                                                                                                   can’t read it
                                        Some random                                                         Some random                         Some random
                                                                            anyway! Har har                                                                                                 anyway! Har har
                    Title               text here. You                                                      text here. You                      text here. You
                                                                            har! Use Css.                                                                                                   har! Use Css.
                                        can’t read it                                                       can’t read it                       can’t read it
                    Some random
                                        anyway! Har har                                                     anyway! Har har                     anyway! Har har
    Title           text here. You                                                              Title                                                           Title
                                        har! Use Css.                                                       har! Use Css.                       har! Use Css.
                    can’t read it                           Title                                                           Title                                                                               Title
    Some random                                                                                 Some random                                                     Some random
                    anyway! Har har
    text here. You                                          Some random                         text here. You              Some random                         text here. You                                  Some random
                    har! Use Css.
    can’t read it                                           text here. You                      can’t read it               text here. You                      can’t read it                   Title           text here. You
    anyway! Har har                                         can’t read it                       anyway! Har har             can’t read it                       anyway! Har har                                 can’t read it
    har! Use Css.                                                                               har! Use Css.                                                   har! Use Css.                   Some random
                                                            anyway! Har har                                                 anyway! Har har                                                                     anyway! Har har
                                                                                                                                                                                                text here. You
                                                            har! Use Css.                                                   har! Use Css.                                                                       har! Use Css.
                            Title                                                               Title                                                                                           can’t read it
                                                                                                                                                                                                anyway! Har har
                            Some random                                 Title                   Some random                                                     Title
                                                                                                                                                                                                har! Use Css.
                            text here. You                              Some random             text here. You                                                  Some random
Title                       can’t read it                               text here. You          can’t read it                                                   text here. You
                            anyway! Har har                             can’t read it           anyway! Har har                                                 can’t read it
Some random                                                                                                                     Title
                            har! Use Css.                               anyway! Har har         har! Use Css.                                                   anyway! Har har
            Title
text here. You                                                                                                                  Some random
                                                                        har! Use Css.                                                                           har! Use Css.
can’t read it                                   Title                                                                           text here. You          Title
            Some random
anyway! Har har                                                                                                                 can’t read it
            text here. You                      Some random                                                                                             Some random                             Title
har! Use Css.                                                                                                                   anyway! Har har
            can’t read it                       text here. You                                                                                          text here. You
                                                                                                                                har! Use Css.                                                   Some random
            anyway! Har har                     can’t read it                                                                                           can’t read it
                            Title                                           Title                                                                                                               text here. You
            har! Use Css.                       anyway! Har har                                                                                         anyway! Har har                         can’t read it
                            Some random         har! Use Css.               Some random                                                                 har! Use Css.                           anyway! Har har
                            text here. You                                  text here. You                              Title                                                   Title
                                                                                                                                                                                                har! Use Css.
                            can’t read it                                   can’t read it
                                                                                                                        Some random                                             Some random
                            anyway! Har har                                 anyway! Har har
                                                                                                                        text here. You                                          text here. You
                            har! Use Css.                                   har! Use Css.
                                                                                                                        can’t read it                                           can’t read it
                                                                                                                        anyway! Har har                                         anyway! Har har
                                                                                                                        har! Use Css.                                           har! Use Css.




                                                                                                                                                                                                                                         35
CSS Presentation




   http://html5course.telerik.com
Homework
•   Add a border to all the exercises from the previous
    presentation (CSS Overview)




                                                          37
Homework (2)
1.   Implement the following video player
      Use tables for the layout
      List tags for the playlist items and the controls




                                                           38
Homework (3)
1.   Create a web page that looks like the Windows
     calculator in Programmer view
      It should look exactly
       the same
      Implement hover effects
       for the buttons
      The calculator should
       not have any functionality




                                                     39
Homework (4)
1.   Implement the following with using tables for the
     layout and CSS for the styles




                                                         40

More Related Content

Viewers also liked

Viewers also liked (10)

Web Design Concepts
Web Design ConceptsWeb Design Concepts
Web Design Concepts
 
Model View ViewModel
Model View ViewModelModel View ViewModel
Model View ViewModel
 
Web design Tools
Web design ToolsWeb design Tools
Web design Tools
 
WPF Concepts
WPF ConceptsWPF Concepts
WPF Concepts
 
Simple Data Binding
Simple Data BindingSimple Data Binding
Simple Data Binding
 
Ado.net
Ado.netAdo.net
Ado.net
 
HTML 5
HTML 5HTML 5
HTML 5
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
For Beginers - ADO.Net
For Beginers - ADO.NetFor Beginers - ADO.Net
For Beginers - ADO.Net
 
ADO.NET -database connection
ADO.NET -database connectionADO.NET -database connection
ADO.NET -database connection
 

Similar to CSS Presentation

CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2jeweltutin
 
Beginning Css
Beginning CssBeginning Css
Beginning Css8ran
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Steve Guinan
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10Jeff Byrnes
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Propertieshstryk
 
Open Standards in the Walled Garden
Open Standards in the Walled GardenOpen Standards in the Walled Garden
Open Standards in the Walled Gardendigitalbindery
 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2Himanshu Pathak
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsKnoldus Inc.
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Gheyath M. Othman
 
Intro to html, css & sass
Intro to html, css & sassIntro to html, css & sass
Intro to html, css & sassSean Wolfe
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete NotesEPAM Systems
 

Similar to CSS Presentation (20)

CSS Part II
CSS Part IICSS Part II
CSS Part II
 
CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2
 
Beginning Css
Beginning CssBeginning Css
Beginning Css
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10
 
Introduction 2 css
Introduction 2 cssIntroduction 2 css
Introduction 2 css
 
CSS
CSSCSS
CSS
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 
Basic css
Basic cssBasic css
Basic css
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
Basic css-tutorial
Basic css-tutorialBasic css-tutorial
Basic css-tutorial
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
Open Standards in the Walled Garden
Open Standards in the Walled GardenOpen Standards in the Walled Garden
Open Standards in the Walled Garden
 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventions
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
Intro to html, css & sass
Intro to html, css & sassIntro to html, css & sass
Intro to html, css & sass
 
css.pdf
css.pdfcss.pdf
css.pdf
 
Css Complete Notes
Css Complete NotesCss Complete Notes
Css Complete Notes
 

More from Doncho Minkov

More from Doncho Minkov (17)

HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and Forms
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
CSS Layout
CSS LayoutCSS Layout
CSS Layout
 
Adobe Photoshop
Adobe PhotoshopAdobe Photoshop
Adobe Photoshop
 
Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
 
WPF Layout Containers
WPF Layout ContainersWPF Layout Containers
WPF Layout Containers
 
WPF Graphics and Animations
WPF Graphics and AnimationsWPF Graphics and Animations
WPF Graphics and Animations
 
Introduction to Cross-platform Mobile Development Course
Introduction to Cross-platform Mobile Development CourseIntroduction to Cross-platform Mobile Development Course
Introduction to Cross-platform Mobile Development Course
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 
HTML5
HTML5HTML5
HTML5
 
CSS Part I
CSS Part ICSS Part I
CSS Part I
 
CSS3
CSS3CSS3
CSS3
 
Workshop Usability
Workshop UsabilityWorkshop Usability
Workshop Usability
 
JavaScript
JavaScriptJavaScript
JavaScript
 
JavaScript OOP
JavaScript OOPJavaScript OOP
JavaScript OOP
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 

Recently uploaded

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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Recently uploaded (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!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 

CSS Presentation

  • 1. CSS Presentation Doncho Minkov Technical Trainer http://minkov.it Telerik Web Design Course html5course.telerik.com
  • 2. Table of Contents  Borders  Overflow  Margins and Paddings  The Box Model  Width and Height  Other CSS Properties 2
  • 4. Borders  border-width: thin, medium, thick or numerical value (e.g. 10px)  border-color: color alias or RGB value  border-style: none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset  Each property can be defined separately for left, top, bottom and right  border-top-style, border-left-color, … 4
  • 5. Border Shorthand Property  border: shorthand rule for setting border properties at once: border: 1px solid red is equal to writing: border-width:1px; border-color:red; border-style:solid;  Specify different borders for the sides via shorthand rules: border-top, border-left, border-right, border-bottom  When to avoid border:0 5
  • 6. Borders Live Demo border-rules.html
  • 8. Rounded Corners  Rounded corners are actually a part of CSS 3  Supported in all major browsers  Firefox, IE 9, Chrome, Opera and Safari  Done by the border-radius property border-radius: [<length>|<%>][<length>|<%>]?  Three ways to define corner radius: border-radius: 15px; border-radius: 15px 15px 15px 10px; border-radius: 15px 20px;
  • 9. Rounded Corners Live Demo
  • 11. Overflow  overflow: defines the behavior of element when content needs more space than you have specified by the size properties or for other reasons. Values:  visible (default) – content spills out of the element  auto - show scrollbars if needed  scroll – always show scrollbars  hidden – any content that cannot fit is clipped 11
  • 12. Overflow Live Demo overflow-rule.html
  • 14. Margin and Padding  margin and padding define the spacing around the element  Numerical value, e.g. 10px or -5px  Can be defined for each of the four sides separately - margin-top, padding-left, …  margin is the spacing outside of the border  padding is the spacing between the border and the content  What are collapsing margins? 14
  • 15. Margin and Padding: Short Rules  margin: 5px;  Sets all four sides to have margin of 5 px;  margin: 10px 20px;  top and bottom to 10px, left and right to 20px;  margin: 5px 3px 8px;  top 5px, left/right 3px, bottom 8px  margin: 1px 3px 5px 7px;  top, right, bottom, left (clockwise from top)  Same for padding 15
  • 16. Margins and Paddings Live Demo margins-paddings-rules.html
  • 18. IE Quirks Mode  When using quirks mode (pages with no DOCTYPE or with a HTML 4 Transitional DOCTYPE) Internet Explorer violates the box model standard! 18
  • 19. H e H i g e h Width t i g h Width t
  • 20. Width and Height  width – defines numerical value for the width of element, e.g. 200px  height – defines numerical value for the height of element, e.g. 100px  By default the height of an element is defined by its content  Inline elements do not apply height, unless you change their display style 20
  • 21. Width and Height Live Demo size-rules.html
  • 22. List Styles For Ordered and Unordered Lists
  • 23. Styles for Lists  List properties are used to define the look and feel of the list items  Mainly to change the list item marker  Normal styles:  List-style-type  Values for <ol>: circle, square,…  Values for <ul>: upper-roman, lower-alpha  Values for both: none ul { list-style-type:none; }
  • 24. List Styles Live Demo
  • 25. Images as Bullets  We can set a image for the bullets of a list  With the property list-style-image ul { list-style-image: url('images/blue-dot.jpg'); }  Does not work equally for all browsers  IE puts less space between the bullet and the content  Shorthand property ul { list-style: bullet url('images/blue-dot.jpg'); }
  • 26. Images as Bullets - Alternative  We can place a background in the left-most  It looks like a image-bullet ul { list-style-type: none; padding: 0px; margin: 0px; } li { background-image: url("images/blue-dot.png"); background-repeat: no-repeat; background-position: 0px 5px; padding-left: 14px; }
  • 27. Styles for List Tags Live Demo
  • 28. Creating a Menu-like List In 5 minutes
  • 29. Creating a Menu-like List  What a menu has?  Some buttons that are arranged from right to left  We need to make it extensible  Create a list  Adding new list item is easy  No worries when disabling the styles
  • 30. Creating a Menu-like List ul.menu { list-style-type: none; padding: 0px; margin: 0px; } li.menu-item { Menu-example float: left; margin: 10px; } 30
  • 31. Creating a Menu-like List Live Demo
  • 33. Other CSS Properties  cursor:specifies the look of the mouse cursor when placed over the element  Values: crosshair, help, pointer, progress, move, hair, col-resize, row- resize, text, wait, copy, drop, and others  white-space – controls the line breaking of text. Value is one of:  nowrap – keeps the text on one line  normal (default) – browser decides whether to brake the lines if needed 33
  • 34. Other CSS Properties Live Demo
  • 35. Maintenance Example Title Title Some random Title Some random Title text here. You Some random text here. You Title can’t read it text here. You Title can’t read it Some random anyway! Har har can’t read it anyway! Har har Title text here. You Title Some random har! Use Css. Some random anyway! Har har har! Use Css. can’t read it text here. You text here. You Some random Some random har! Use Css. anyway! Har har can’t read it can’t read it text here. You text here. You Title har! Use Css. anyway! Har har anyway! Har har can’t read it can’t read it Title Title har! Use Css. Some random har! Use Css. anyway! Har har anyway! Har har text here. You Some random Some random har! Use Css. har! Use Css. can’t read it text here. You text here. You Title anyway! Har har can’t read it can’t read it Title Some random har! Use Css. anyway! Har har anyway! Har har Some random Title Title Title text here. You har! Use Css. har! Use Css. text here. You Title can’t read it Some random Some random Some random can’t read it anyway! Har har Some random text here. You text here. You Title text here. You anyway! Har har har! Use Css. text here. You can’t read it can’t read it can’t read it Title har! Use Css. Some random can’t read it anyway! Har har anyway! Har har anyway! Har har text here. You Title Some random anyway! Har har har! Use Css. har! Use Css. har! Use Css. Title har! Use Css. Title can’t read it text here. You Some random anyway! Har har can’t read it Some random Some random Title text here. You har! Use Css. anyway! Har har text here. You text here. You can’t read it Some random har! Use Css. can’t read it can’t read it anyway! Har har text here. You anyway! Har har anyway! Har har har! Use Css. Title can’t read it Title har! Use Css. har! Use Css. anyway! Har har Some random har! Use Css. Some random CSS Title text here. You text here. You Title Title can’t read it can’t read it Some random Some random anyway! Har har anyway! Har har text here. You Some random Title Title Title text here. You har! Use Css. har! Use Css. can’t read it text here. You can’t read it Some random Some random Some random anyway! Har har can’t read it anyway! Har har Title text here. You text here. You text here. You har! Use Css. anyway! Har har har! Use Css. can’t read it can’t read it can’t read it har! Use Css. Some random anyway! Har har anyway! Har har anyway! Har har text here. You Title Title file har! Use Css. har! Use Css. har! Use Css. can’t read it Some random Some random anyway! Har har Title text here. You Title Title text here. You har! Use Css. can’t read it can’t read it Some random Some random Some random anyway! Har har anyway! Har har Title text here. You text here. You text here. You har! Use Css. har! Use Css. can’t read it can’t read it can’t read it Some random anyway! Har har anyway! Har har anyway! Har har Title text here. You Title Title har! Use Css. har! Use Css. har! Use Css. can’t read it Title Title Title Some random Some random Some random anyway! Har har text here. You Some random text here. You Some random text here. You Some random har! Use Css. can’t read it text here. You can’t read it text here. You can’t read it Title text here. You anyway! Har har can’t read it anyway! Har har can’t read it anyway! Har har can’t read it har! Use Css. har! Use Css. har! Use Css. Some random anyway! Har har anyway! Har har anyway! Har har text here. You har! Use Css. har! Use Css. har! Use Css. Title Title can’t read it anyway! Har har Some random Title Some random Title har! Use Css. text here. You Some random text here. You Some random Title can’t read it text here. You can’t read it text here. You anyway! Har har can’t read it anyway! Har har can’t read it Some random Title har! Use Css. anyway! Har har har! Use Css. anyway! Har har Title text here. You Some random har! Use Css. har! Use Css. can’t read it Title text here. You Title Some random anyway! Har har can’t read it text here. You Some random Some random Title har! Use Css. anyway! Har har can’t read it text here. You text here. You har! Use Css. Some random anyway! Har har can’t read it can’t read it Title Title text here. You har! Use Css. anyway! Har har anyway! Har har can’t read it Some random har! Use Css. Some random har! Use Css. anyway! Har har text here. You text here. You Title Title har! Use Css. can’t read it can’t read it Some random Some random anyway! Har har anyway! Har har text here. You text here. You har! Use Css. har! Use Css. can’t read it can’t read it anyway! Har har anyway! Har har har! Use Css. har! Use Css. 35
  • 36. CSS Presentation http://html5course.telerik.com
  • 37. Homework • Add a border to all the exercises from the previous presentation (CSS Overview) 37
  • 38. Homework (2) 1. Implement the following video player  Use tables for the layout  List tags for the playlist items and the controls 38
  • 39. Homework (3) 1. Create a web page that looks like the Windows calculator in Programmer view  It should look exactly the same  Implement hover effects for the buttons  The calculator should not have any functionality 39
  • 40. Homework (4) 1. Implement the following with using tables for the layout and CSS for the styles 40