SlideShare a Scribd company logo
Pemrograman Web 3 - CSS Basic Part 2
CSS Outline
The CSS outline properties specify the style, color, and width
of an outline.
An outline is a line that is drawn around elements (outside the
borders) to make the element "stand out".
CSS Outline Style
The outline-style property specifies the style of the outline. The outline-style property can have
one of the following values:
• dotted - Defines a dotted outline
• dashed - Defines a dashed outline
• solid - Defines a solid outline
• double - Defines a double outline
• groove - Defines a 3D grooved outline. The effect depends on the outline-color value
• ridge - Defines a 3D ridged outline. The effect depends on the outline-color value
• inset - Defines a 3D inset outline. The effect depends on the outline-color value
• outset - Defines a 3D outset outline. The effect depends on the outline-color value
• none - Defines no outline
• hidden - Defines a hidden outline
Example
p {
border: 1px solid black;
outline-color: red;
}
p.dotted {outline-style: dotted;}
p.dashed {outline-style: dashed;}
p.solid {outline-style: solid;}
p.double {outline-style: double;}
p.groove {outline-style: groove;}
p.ridge {outline-style: ridge;}
p.inset {outline-style: inset;}
p.outset {outline-style: outset;}
CSS Text
Text Color -> color: #f0f0f0;
Alignment -> text-align: center; (left, right, justify)
Decoration -> text-decoration: overline; (line-through, underline)
Indentation -> text-indent: 25px;
Letter Spacing -> letter-spacing: -3px;
Text Tranformation -> text-transform: uppercase; (lowercase,
capitalize)
Line Height -> line-height: 0.7;
Text Direction -> direction: rtl;
Word Spacing -> word-spacing: 15px;
Text Shadow -> text-shadow: 4px 3px blue;
CSS Font
In CSS, there are two types of font family names:
• generic family - a group of font families with a similar look
(like "Serif" or "Monospace")
• font family - a specific font family (like "Times New Roman" or
"Arial")
Generic family Font family Description
Serif
Times New Roman
Georgia
Serif fonts have small lines at the ends on some characters
Sans-serif
Arial
Verdana
"Sans" means without - these fonts do not have the lines at the
ends of characters
Monospace
Courier New
Lucida Console
All monospace characters have the same width
CSS Font Family
The font-family property should hold several font names as a
"fallback" system. If the browser does not support the first font, it
tries the next font, and so on.
p {
font-family: "Times New Roman", Times, serif;
}
Note: Untuk penulisan nama font yang menggunakan lebih dari
satu kata, gunakan tanda petik (“…..”)
CSS Font Style
p.normal {
font-style: normal;
}
p.italic {
font-style: italic;
}
p.oblique {
font-style: oblique;
}
CSS Font Size
The font-size property sets the size of the text. Being able to manage the text size is
important in web design. However, you should not use font size adjustments to make
paragraphs look like headings, or headings look like paragraphs.
The font-size value can be an absolute, or relative size.
Absolute size:
• Sets the text to a specified size
• Does not allow a user to change the text size in all browsers (bad for accessibility
reasons)
• Absolute size is useful when the physical size of the output is known
Relative size:
• Sets the size relative to surrounding elements
• Allows a user to change the text size in browsers
Set font-size with pixels
h1 {
font-size: 40px;
}
h2 {
font-size: 30px;
}
p {
font-size: 14px;
}
Set font-size with Em
To allow users to resize the text (in the browser menu), many
developers use em instead of pixels.
1em is equal to the current font size. The default text size in
browsers is 16px. So, the default size of 1em is 16px.
The size can be calculated from pixels to em using this
formula: pixels/16=em
Example em unit
h1 {
font-size: 2.5em; /* 40px/16=2.5em */
}
h2 {
font-size: 1.875em; /* 30px/16=1.875em */
}
p {
font-size: 0.875em; /* 14px/16=0.875em */
}
CSS Font Weight
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
CSS Font Variant
p.normal {
font-variant: normal;
}
p.small {
font-variant: small-caps;
}
In a small-caps font, all lowercase letters are converted to
uppercase letters. However, the converted uppercase letters
appears in a smaller font size than the original uppercase letters in
the text.
CSS Icon : Font Awesome
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/4.7.0/css/font-awesome.min.css">
<p>Some Font Awesome icons:</p>
<i class="fa fa-cloud"></i>
<i class="fa fa-heart"></i>
<i class="fa fa-car"></i>
<i class="fa fa-file"></i>
<i class="fa fa-bars"></i>
<p>Styled Font Awesome icons (size and color):</p>
<i class="fa fa-cloud" style="font-size:24px;"></i>
<i class="fa fa-cloud" style="font-size:36px;"></i>
<i class="fa fa-cloud" style="font-size:48px;color:red;"></i>
<i class="fa fa-cloud" style="font-size:60px;color:lightblue;"></i>
CSS Icon : Bootstrap Icons
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<body class="container">
<p>Some Bootstrap icons:</p>
<i class="glyphicon glyphicon-cloud"></i>
<i class="glyphicon glyphicon-remove"></i>
<i class="glyphicon glyphicon-user"></i>
<i class="glyphicon glyphicon-envelope"></i>
<i class="glyphicon glyphicon-thumbs-up"></i>
<p>Styled Bootstrap icons (size and color):</p>
<i class="glyphicon glyphicon-cloud" style="font-size:24px;"></i>
<i class="glyphicon glyphicon-cloud" style="font-size:36px;"></i>
<i class="glyphicon glyphicon-cloud" style="font-size:48px;color:red;"></i>
<i class="glyphicon glyphicon-cloud" style="font-size:60px;color:lightblue;"></i>
CSS Icon : Google Icons
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<p>Some Google icons:</p>
<i class="material-icons">cloud</i>
<i class="material-icons">favorite</i>
<i class="material-icons">attachment</i>
<i class="material-icons">computer</i>
<i class="material-icons">traffic</i>
<p>Styled Google icons (size and color):</p>
<i class="material-icons" style="font-size:24px;">cloud</i>
<i class="material-icons" style="font-size:36px;">cloud</i>
<i class="material-icons" style="font-size:48px;color:red;">cloud</i>
<i class="material-icons" style="font-size:60px;color:lightblue;">cloud</i>
CSS Styling Links
Links can be styled differently depending on what state they
are in.
The four links states are:
• a:link - a normal, unvisited link
• a:visited - a link the user has visited
• a:hover - a link when the user mouses over it
• a:active - a link the moment it is clicked
Example
/* unvisited link */
a:link {
color: red;
}
/* visited link */
a:visited {
color: green;
}
/* mouse over link */
a:hover {
color: hotpink;
}
/* selected link */
a:active {
color: blue;
}
CSS Text Decoration Links
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: underline;
}
CSS BG Color Links
a:link {
background-color: yellow;
}
a:visited {
background-color: cyan;
}
a:hover {
background-color: lightgreen;
}
a:active {
background-color: hotpink;
}
Make a button links with CSS
a:link, a:visited {
background-color: #f44336;
color: white;
padding: 14px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
}
a:hover, a:active {
background-color: red;
}
HTML Lists and CSS Properties
In HTML, there are two main types of lists:
• unordered lists (<ul>) - the list items are marked with bullets
• ordered lists (<ol>) - the list items are marked with numbers
or letters
The CSS list properties allow you to:
• Set different list item markers for ordered lists
• Set different list item markers for unordered lists
• Set an image as the list item marker
• Add background colors to lists and list items
CSS Lists Properties
ul.a {
list-style-type: circle;
}
ul.b {
list-style-type: square;
}
ol.c {
list-style-type: upper-roman;
}
ol.d {
list-style-type: lower-alpha;
}
CSS Styling List with Colors
ol {
background: #ff9999;
padding: 20px;
}
ul {
background: #3399ff;
padding: 20px;
}
ol li {
background: #ffe5e5;
padding: 5px;
margin-left: 35px;
}
ul li {
background: #cce5ff;
margin: 5px;
}
CSS Table Properties
• Text Align (Horizontal) -> text-align: left; (center, right)
• Text Align (Vertical) -> vertical-align: top; (center, bottom)
• Table Padding -> padding: 10px; (sama halnya dengan
padding border)
• Dividers -> bottom-border: 1px solid #000; (sama seperti
pembuatan border, bisa gunakan syntax border: TOPpx
RIGHTpx BOTpx LEFTpx)
• Hover Table -> tr:hover {background-color: #f5f5f5}
• Striped Table Colors -> tr:nth-child(even) {background-
color: #f2f2f2} (ada 2 pilihan, yaitu even & odd)
• Responsive Table -> overflow-x:auto
CSS Table : Border Spacing &
Collapse
length(h) length(v) • Specifies the distance between the borders of adjacent cells in px, cm, etc.
Negative values are not allowed. If one length value is specified, it
specifies both the horizontal and vertical spacing
• If two length values are specified, the first sets the horizontal spacing and
the second sets the vertical spacing
separate • Borders are detached (border-spacing and empty-cells properties will not
be ignored). This is default
collapse • Borders are collapsed into a single border when possible (border-spacing
and empty-cells properties will be ignored)
border-spacing: 10px 50px;
border-collapse: separate|collapse|initial|inherit;
CSS Display
Override Lists Default Display -> li {display: inline;}
Display None -> display: none;
Visibility -> visibility: hidden;
(visible|hidden|collapse|initial|inherit)
CSS Max Width
Setting the width of a block-level element will prevent it from
stretching out to the edges of its container. Then, you can set the
margins to auto, to horizontally center the element within its
container. The element will take up the specified width, and the
remaining space will be split equally between the two margins
div.ext-width {
width: 500px;
margin: auto;
border: 3px solid #73AD21;
}
Using max-width instead, in this situation, will improve the
browser's handling of small windows. This is important when
making a site usable on small devices.
div.ext-maxwidth {
max-width: 500px;
margin: auto;
border: 3px solid #73AD21;
}
Source
• w3schools.com
• stackoverflow.com
• Font Awsome, Bootstrap, & Google

More Related Content

PDF
Pemrograman Web 2 - CSS
PDF
Pemrograman Web 4 - Bootstrap 3
PPT
CSS Part I
PPTX
CSS3 notes
ODP
Cascading Style Sheets - Part 02
PPTX
Css & css3
PPT
CSS for Beginners
PPTX
CSS Cascade Style Sheet
Pemrograman Web 2 - CSS
Pemrograman Web 4 - Bootstrap 3
CSS Part I
CSS3 notes
Cascading Style Sheets - Part 02
Css & css3
CSS for Beginners
CSS Cascade Style Sheet

What's hot (19)

PPT
CSS Part II
PPT
How Cascading Style Sheets (CSS) Works
PPT
Basics Of Css And Some Common Mistakes
PPT
CSS
PPT
cascading style sheet ppt
PPTX
Web Engineering - Basic CSS Properties
PDF
CSS Boc model
DOC
Css 1
 
PPT
CSS Basic and Common Errors
PPTX
CSS Basics
PPTX
CSS_Day_Two (W3schools)
PPTX
CSS_Day_ONE (W3schools)
PPTX
CSS_Day_Three (W3schools)
PPSX
Introduction to css part1
PPTX
Css Basics
PDF
CSS: a rapidly changing world
CSS Part II
How Cascading Style Sheets (CSS) Works
Basics Of Css And Some Common Mistakes
CSS
cascading style sheet ppt
Web Engineering - Basic CSS Properties
CSS Boc model
Css 1
 
CSS Basic and Common Errors
CSS Basics
CSS_Day_Two (W3schools)
CSS_Day_ONE (W3schools)
CSS_Day_Three (W3schools)
Introduction to css part1
Css Basics
CSS: a rapidly changing world
Ad

Similar to Pemrograman Web 3 - CSS Basic Part 2 (20)

PPTX
session2_cascading_style_sheet_cssc.pptx
PPTX
session2 cascading style sheet course.pptx
PPTX
session2 css cascade style sheet course.pptx
PDF
Intro to css & sass
PPTX
chapter-gesgsdkfhhgagfhagsdhfgdhfdhda3-css .pptx
PPTX
css3.0.( Cascading Style Sheets ) pptx
PPTX
PPTX
CSS tutorial chapter 2
PDF
cascading stylesheet_cssppt-100604051600-phpapp02.pdf
PDF
DOCX
PPTX
css3.pptx
PPTX
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
PDF
5. Web Technology CSS Advanced
PDF
01 Introduction To CSS
PPT
Web technology
PDF
Introduction to CSS3
PPTX
Web Engineering - Introduction to CSS
session2_cascading_style_sheet_cssc.pptx
session2 cascading style sheet course.pptx
session2 css cascade style sheet course.pptx
Intro to css & sass
chapter-gesgsdkfhhgagfhagsdhfgdhfdhda3-css .pptx
css3.0.( Cascading Style Sheets ) pptx
CSS tutorial chapter 2
cascading stylesheet_cssppt-100604051600-phpapp02.pdf
css3.pptx
Chapter_1_Web_Technologies_Basics (CSS)_Part_2.pptx
5. Web Technology CSS Advanced
01 Introduction To CSS
Web technology
Introduction to CSS3
Web Engineering - Introduction to CSS
Ad

More from Nur Fadli Utomo (20)

PDF
Pemrograman Web 9 - Input Form DB dan Session
PDF
Pemrograman Web 8 - MySQL
PDF
Desain Grafis 6 - UI/UX on Web Application
PDF
Pemrograman Web 7 - Basic PHP
PDF
Pemrograman Web 6 - jQuery
PDF
Pemrograman Web 5 - Javascript
PDF
Desain Grafis 5 - Good Graphic Design
PDF
Desain Grafis 3 - Color
PDF
Desain Grafis 4 - UI/UX
PDF
Desain Grafis 2 - Kerning Type
PDF
Desain Grafis 1 - Basic
PDF
Pemrograman Web - HTML
PDF
PC 9 - Matlab 2nd Chapter
PDF
PC 8 - Matlab
PDF
Pengolahan Citra 7 - Warna
PDF
GK 3 Penggambaran Titik dan Garis
PDF
Citra Biner
PDF
Pengolahan Citra 4 - Histogram Citra
PDF
Pengolahan Citra 3 - Operasi-operasi Digital
PDF
Grafika komputer 2
Pemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 8 - MySQL
Desain Grafis 6 - UI/UX on Web Application
Pemrograman Web 7 - Basic PHP
Pemrograman Web 6 - jQuery
Pemrograman Web 5 - Javascript
Desain Grafis 5 - Good Graphic Design
Desain Grafis 3 - Color
Desain Grafis 4 - UI/UX
Desain Grafis 2 - Kerning Type
Desain Grafis 1 - Basic
Pemrograman Web - HTML
PC 9 - Matlab 2nd Chapter
PC 8 - Matlab
Pengolahan Citra 7 - Warna
GK 3 Penggambaran Titik dan Garis
Citra Biner
Pengolahan Citra 4 - Histogram Citra
Pengolahan Citra 3 - Operasi-operasi Digital
Grafika komputer 2

Recently uploaded (20)

PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
AI in Product Development-omnex systems
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Digital Strategies for Manufacturing Companies
2025 Textile ERP Trends: SAP, Odoo & Oracle
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Design an Analysis of Algorithms I-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Navsoft: AI-Powered Business Solutions & Custom Software Development
PTS Company Brochure 2025 (1).pdf.......
How to Choose the Right IT Partner for Your Business in Malaysia
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Operating system designcfffgfgggggggvggggggggg
Odoo Companies in India – Driving Business Transformation.pdf
Reimagine Home Health with the Power of Agentic AI​
CHAPTER 2 - PM Management and IT Context
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
AI in Product Development-omnex systems
How to Migrate SBCGlobal Email to Yahoo Easily
Digital Strategies for Manufacturing Companies

Pemrograman Web 3 - CSS Basic Part 2

  • 2. CSS Outline The CSS outline properties specify the style, color, and width of an outline. An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
  • 3. CSS Outline Style The outline-style property specifies the style of the outline. The outline-style property can have one of the following values: • dotted - Defines a dotted outline • dashed - Defines a dashed outline • solid - Defines a solid outline • double - Defines a double outline • groove - Defines a 3D grooved outline. The effect depends on the outline-color value • ridge - Defines a 3D ridged outline. The effect depends on the outline-color value • inset - Defines a 3D inset outline. The effect depends on the outline-color value • outset - Defines a 3D outset outline. The effect depends on the outline-color value • none - Defines no outline • hidden - Defines a hidden outline
  • 4. Example p { border: 1px solid black; outline-color: red; } p.dotted {outline-style: dotted;} p.dashed {outline-style: dashed;} p.solid {outline-style: solid;} p.double {outline-style: double;} p.groove {outline-style: groove;} p.ridge {outline-style: ridge;} p.inset {outline-style: inset;} p.outset {outline-style: outset;}
  • 5. CSS Text Text Color -> color: #f0f0f0; Alignment -> text-align: center; (left, right, justify) Decoration -> text-decoration: overline; (line-through, underline) Indentation -> text-indent: 25px; Letter Spacing -> letter-spacing: -3px; Text Tranformation -> text-transform: uppercase; (lowercase, capitalize) Line Height -> line-height: 0.7; Text Direction -> direction: rtl; Word Spacing -> word-spacing: 15px; Text Shadow -> text-shadow: 4px 3px blue;
  • 6. CSS Font In CSS, there are two types of font family names: • generic family - a group of font families with a similar look (like "Serif" or "Monospace") • font family - a specific font family (like "Times New Roman" or "Arial") Generic family Font family Description Serif Times New Roman Georgia Serif fonts have small lines at the ends on some characters Sans-serif Arial Verdana "Sans" means without - these fonts do not have the lines at the ends of characters Monospace Courier New Lucida Console All monospace characters have the same width
  • 7. CSS Font Family The font-family property should hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font, and so on. p { font-family: "Times New Roman", Times, serif; } Note: Untuk penulisan nama font yang menggunakan lebih dari satu kata, gunakan tanda petik (“…..”)
  • 8. CSS Font Style p.normal { font-style: normal; } p.italic { font-style: italic; } p.oblique { font-style: oblique; }
  • 9. CSS Font Size The font-size property sets the size of the text. Being able to manage the text size is important in web design. However, you should not use font size adjustments to make paragraphs look like headings, or headings look like paragraphs. The font-size value can be an absolute, or relative size. Absolute size: • Sets the text to a specified size • Does not allow a user to change the text size in all browsers (bad for accessibility reasons) • Absolute size is useful when the physical size of the output is known Relative size: • Sets the size relative to surrounding elements • Allows a user to change the text size in browsers
  • 10. Set font-size with pixels h1 { font-size: 40px; } h2 { font-size: 30px; } p { font-size: 14px; }
  • 11. Set font-size with Em To allow users to resize the text (in the browser menu), many developers use em instead of pixels. 1em is equal to the current font size. The default text size in browsers is 16px. So, the default size of 1em is 16px. The size can be calculated from pixels to em using this formula: pixels/16=em
  • 12. Example em unit h1 { font-size: 2.5em; /* 40px/16=2.5em */ } h2 { font-size: 1.875em; /* 30px/16=1.875em */ } p { font-size: 0.875em; /* 14px/16=0.875em */ }
  • 13. CSS Font Weight p.normal { font-weight: normal; } p.thick { font-weight: bold; }
  • 14. CSS Font Variant p.normal { font-variant: normal; } p.small { font-variant: small-caps; } In a small-caps font, all lowercase letters are converted to uppercase letters. However, the converted uppercase letters appears in a smaller font size than the original uppercase letters in the text.
  • 15. CSS Icon : Font Awesome <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font- awesome/4.7.0/css/font-awesome.min.css"> <p>Some Font Awesome icons:</p> <i class="fa fa-cloud"></i> <i class="fa fa-heart"></i> <i class="fa fa-car"></i> <i class="fa fa-file"></i> <i class="fa fa-bars"></i> <p>Styled Font Awesome icons (size and color):</p> <i class="fa fa-cloud" style="font-size:24px;"></i> <i class="fa fa-cloud" style="font-size:36px;"></i> <i class="fa fa-cloud" style="font-size:48px;color:red;"></i> <i class="fa fa-cloud" style="font-size:60px;color:lightblue;"></i>
  • 16. CSS Icon : Bootstrap Icons <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <body class="container"> <p>Some Bootstrap icons:</p> <i class="glyphicon glyphicon-cloud"></i> <i class="glyphicon glyphicon-remove"></i> <i class="glyphicon glyphicon-user"></i> <i class="glyphicon glyphicon-envelope"></i> <i class="glyphicon glyphicon-thumbs-up"></i> <p>Styled Bootstrap icons (size and color):</p> <i class="glyphicon glyphicon-cloud" style="font-size:24px;"></i> <i class="glyphicon glyphicon-cloud" style="font-size:36px;"></i> <i class="glyphicon glyphicon-cloud" style="font-size:48px;color:red;"></i> <i class="glyphicon glyphicon-cloud" style="font-size:60px;color:lightblue;"></i>
  • 17. CSS Icon : Google Icons <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <p>Some Google icons:</p> <i class="material-icons">cloud</i> <i class="material-icons">favorite</i> <i class="material-icons">attachment</i> <i class="material-icons">computer</i> <i class="material-icons">traffic</i> <p>Styled Google icons (size and color):</p> <i class="material-icons" style="font-size:24px;">cloud</i> <i class="material-icons" style="font-size:36px;">cloud</i> <i class="material-icons" style="font-size:48px;color:red;">cloud</i> <i class="material-icons" style="font-size:60px;color:lightblue;">cloud</i>
  • 18. CSS Styling Links Links can be styled differently depending on what state they are in. The four links states are: • a:link - a normal, unvisited link • a:visited - a link the user has visited • a:hover - a link when the user mouses over it • a:active - a link the moment it is clicked
  • 19. Example /* unvisited link */ a:link { color: red; } /* visited link */ a:visited { color: green; } /* mouse over link */ a:hover { color: hotpink; } /* selected link */ a:active { color: blue; }
  • 20. CSS Text Decoration Links a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: underline; }
  • 21. CSS BG Color Links a:link { background-color: yellow; } a:visited { background-color: cyan; } a:hover { background-color: lightgreen; } a:active { background-color: hotpink; }
  • 22. Make a button links with CSS a:link, a:visited { background-color: #f44336; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: red; }
  • 23. HTML Lists and CSS Properties In HTML, there are two main types of lists: • unordered lists (<ul>) - the list items are marked with bullets • ordered lists (<ol>) - the list items are marked with numbers or letters The CSS list properties allow you to: • Set different list item markers for ordered lists • Set different list item markers for unordered lists • Set an image as the list item marker • Add background colors to lists and list items
  • 24. CSS Lists Properties ul.a { list-style-type: circle; } ul.b { list-style-type: square; } ol.c { list-style-type: upper-roman; } ol.d { list-style-type: lower-alpha; }
  • 25. CSS Styling List with Colors ol { background: #ff9999; padding: 20px; } ul { background: #3399ff; padding: 20px; } ol li { background: #ffe5e5; padding: 5px; margin-left: 35px; } ul li { background: #cce5ff; margin: 5px; }
  • 26. CSS Table Properties • Text Align (Horizontal) -> text-align: left; (center, right) • Text Align (Vertical) -> vertical-align: top; (center, bottom) • Table Padding -> padding: 10px; (sama halnya dengan padding border) • Dividers -> bottom-border: 1px solid #000; (sama seperti pembuatan border, bisa gunakan syntax border: TOPpx RIGHTpx BOTpx LEFTpx) • Hover Table -> tr:hover {background-color: #f5f5f5} • Striped Table Colors -> tr:nth-child(even) {background- color: #f2f2f2} (ada 2 pilihan, yaitu even & odd) • Responsive Table -> overflow-x:auto
  • 27. CSS Table : Border Spacing & Collapse length(h) length(v) • Specifies the distance between the borders of adjacent cells in px, cm, etc. Negative values are not allowed. If one length value is specified, it specifies both the horizontal and vertical spacing • If two length values are specified, the first sets the horizontal spacing and the second sets the vertical spacing separate • Borders are detached (border-spacing and empty-cells properties will not be ignored). This is default collapse • Borders are collapsed into a single border when possible (border-spacing and empty-cells properties will be ignored) border-spacing: 10px 50px; border-collapse: separate|collapse|initial|inherit;
  • 28. CSS Display Override Lists Default Display -> li {display: inline;} Display None -> display: none; Visibility -> visibility: hidden; (visible|hidden|collapse|initial|inherit)
  • 29. CSS Max Width Setting the width of a block-level element will prevent it from stretching out to the edges of its container. Then, you can set the margins to auto, to horizontally center the element within its container. The element will take up the specified width, and the remaining space will be split equally between the two margins div.ext-width { width: 500px; margin: auto; border: 3px solid #73AD21; }
  • 30. Using max-width instead, in this situation, will improve the browser's handling of small windows. This is important when making a site usable on small devices. div.ext-maxwidth { max-width: 500px; margin: auto; border: 3px solid #73AD21; }
  • 31. Source • w3schools.com • stackoverflow.com • Font Awsome, Bootstrap, & Google