All you need to know about CSS:
Selectors
Value Processing
Cascading
Box Model
Visual Formatting Model
Block Formatting Context
Stacking Context
At-Rules
Units
Presentation with examples:
http://rawgit.com/vzhidal/HTML-CSS-Training-Presentations/master/css-basics.html
this presentation covers the following topics which are as follows
1. Introduction of css
2. History of css
3. Types of css styling
4. Css syntax
5. Css Selector
6. Css Variations Or Css Versions
this presentation covers the following topics which are as follows
1. Introduction of css
2. History of css
3. Types of css styling
4. Css syntax
5. Css Selector
6. Css Variations Or Css Versions
CSS stands for Cascading Style Sheets
Styles define how to display HTML elements
External Style Sheets can save a lot of work
Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!
about this presentation:
1) this presentation was a quickie for non-tech employees, who wanted a basic understanding of html/css, as it related to a white-label SAAS product;
2) the back-end/front-end definitions relate to the specific application (it's inaccurate if node.js is in the picture)
HTML is the backbone of Internet. Learn the basics of HTML, you can create your own website.
If you have any doubt contact me for more details. WhatsApp:8008877940
CSS stands for Cascading Style Sheets
Styles define how to display HTML elements
External Style Sheets can save a lot of work
Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!
about this presentation:
1) this presentation was a quickie for non-tech employees, who wanted a basic understanding of html/css, as it related to a white-label SAAS product;
2) the back-end/front-end definitions relate to the specific application (it's inaccurate if node.js is in the picture)
HTML is the backbone of Internet. Learn the basics of HTML, you can create your own website.
If you have any doubt contact me for more details. WhatsApp:8008877940
A standards-based method for controlling the look and feel of XML content.
Comprised of Rules to control elements in the document.
Designed to separate formatting from the content while being flexible and scalable
CSS specifies a priority scheme to determine which style rules apply if more than one rule matches against a particular element.
This tutorial covers all the basics of CSS. This is a quick guide to CSS.Anyone having understanding of HTML can easily learn CSS in 10 minutes with this video tutorial. It covers all the basics of Style Sheets in Web designing.
For more detail you can also visit our Tech Blogs at https://msatechnosoft.in/blog/tech-blogs
Automated Analysis of CSS Rules to Support Style MaintenanceAbhishek Rakshe
This paper talks about the following -
- A discussion of challenges surrounding CSS rule comprehension and maintenance.
- A fully automated technique and algorithms for inferring knowledge about actual style code coverage and selector effectively.
- An open-source tool CILLA for implementing the analysis technique and algorithms.
- An empirical study to validate the proposed technique, demonstrating its efficacy and real-world relevance.
This is part of my classroom curriculum on IBM Rational Host Access Transformation Services. More material is available from our on site classroom courseware.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
4. HISTORY
1994
CSS was first proposed by Håkon Wium Lie.
1996
CSS level 1 was published as a W3C Recommendation.
1998
CSS level 2 was published as a W3C Recommendation.
2011
CSS level 2.1 was published as a W3C
Recommendation.
5. CSS3
CSS 3 is divided into several separate documents called
"modules".
Each module adds functionality and/or replaces part of
the CSS2.1 specification.
19. SIMPLE SELECTORS
Pattern Meaning Level
* any element 2
E an element of type E 1
E.warning an E element whose class is "warning" 1
E#myid an E element with ID equal to "myid" 1
20. CLASS
can be used several times
ID
can only be used once
Use CSS classes where it’s possible, to make your styles
reusable on the page.
21. ATTRIBUTE SELECTORS
Pattern Meaning Level
E[foo] an E element with a "foo" attribute 2
E[foo="bar"] an E element whose "foo" attribute value is
exactly equal to "bar"
2
E[foo~="bar"] an E element whose "foo" attribute value is a list
of whitespace-separated values, one of which is
exactly equal to "bar"
2
E[foo|="en"] an E element whose "foo" attribute has a hyphen-
separated list of values beginning (from the left)
with "en"
2
22. ATTRIBUTE SELECTORS
Pattern Meaning Level
E[foo^="bar"] an E element whose "foo" attribute value begins
exactly with the string "bar"
3
E[foo$="bar"] an E element whose "foo" attribute value ends
exactly with the string "bar"
3
E[foo*="bar"] an E element whose "foo" attribute value contains
the substring "bar"
3
23. PSEUDO CLASSES
Pattern Meaning Level
E:link
E:visited
an E element being the source anchor of a hyperlink of
which the target is not yet visited (:link) or already
visited (:visited)
1
E:active
E:hover
E:focus
an E element during certain user actions 1
and
2
E:target an E element being the target of the referring URI 3
24. PSEUDO CLASSES
Pattern Meaning Level
E:lang(fr) an element of type E in language "fr" (the document
language specifies how language is determined)
2
E:enabled
E:disabled
a user interface element E which is enabled or
disabled
3
E:checked a user interface element E which is checked (for
instance a radio-button or checkbox)
3
E:not(s) an E element that does not match simple selector s 3
25. PSEUDO CLASSES
(STRUCTURAL)
Pattern Meaning Level
E:root an E element, root of the document 3
E:nth-
child(n)
an E element, the n-th child of its parent 3
E:nth-last-
child(n)
an E element, the n-th child of its parent, counting
from the last one
3
E:nth-of-
type(n)
an E element, the n-th sibling of its type 3
26. PSEUDO CLASSES
(STRUCTURAL)
Pattern Meaning Level
E:nth-last-of-
type(n)
an E element, the n-th sibling of its type, counting
from the last one
3
E:first-child an E element, first child of its parent 2
E:last-child an E element, last child of its parent 3
E:first-of-type an E element, first sibling of its type 3
27. PSEUDO CLASSES
(STRUCTURAL)
Pattern Meaning Level
E:last-of-
type
an E element, last sibling of its type 3
E:only-child an E element, only child of its parent 3
E:only-of-
type
an E element, only sibling of its type 3
E:empty an E element that has no children (including text
nodes)
3
28. PSEUDO ELEMENTS
Pattern Meaning Level
E::first-line the first formatted line of an E element 1
E::first-letter the first formatted letter of an E element 1
E::before generated content before an E element 2
E::after generated content after an E element 2
29. COMBINATORS
Pattern Meaning Level
E F an F element descendant of an E element 1
E > F an F element child of an E element 2
E + F an F element immediately preceded by an E element 2
E ~ F an F element preceded by an E element 3
30. THE KEY SELECTOR
The key selector is the right-most part of a larger CSS
selector. This is what the user agent looks for first.
33. VALUE PROCESSING
A user agent must assign a value to every property that
applies to the target media type to every box in the
formatting structure.
34. CALCULATION
Collecting all the declared values applied to an element.
Cascading yields the cascaded value.
Defaulting yields the specified value.
Resolving value dependencies yields the computed value.
Formatting the document yields the used value.
Transforming to the actual value based on constraints of
the display environment.
35. CALCULATION EXAMPLES
Property Winning
declaration
Cascaded
value
Specified value Computed
value
Used
value
Actual
value
font-size font-size:
1.2em
1.2em 1.2em 14.1px 14.1px 14px
width width: 80% 80% 80% 80% 354.2px 354px
width width: auto auto auto auto 134px 134px
height height: auto auto auto auto 176px 176px
page-break-
after
(none) (none) auto (initial value) auto auto auto
37. FILTERING
In order to find the declared values, user agents must first
identify all declarations that apply to each element.
38. FILTERING
A declaration applies to an element if:
It belongs to a style sheet that currently applies to this
document.
It is not qualified by a conditional rule with a false
condition.
It belongs to a style rule whose selector matches the
element.
It is syntactically valid: the declaration’s property is a
known property name, and the declaration’s value
matches the syntax for that property.
40. CASCADING
The cascade takes a unordered list of declared values for a
given property on a given element, sorts them by their
declaration’s precedence, and outputs a single cascaded
value.
45. CASCADING ORDER
WHICH CSS RULES “WIN”?
There are four steps to determine which CSS rules will
“win”.
46. STEP 1
Gather all the declarations that apply to an element and
property from browser, author and user style sheets.
47. STEP 2
Sort the gathered declarations according to:
origin
user agent
author
user
importance
normal
!important
48. FROM LOWEST TO HIGHEST
PRIORITY
Normal declarations in user agent style sheet.
Normal declarations in user style sheet.
Normal declarations in author style sheet.
!important declarations in author style sheet.
!important declaration in user style sheet.
!important declaration in user agent style sheet.
49. STEP 3
If declarations have the same origin or importance then the
declaration’s selectors need to be scored, to see which
declaration will “win”.
50. SELECTORS SPECIFICITY
1. Inline style.
2. Count the number of IDs.
3. Count the number of
classes, attributes and
pseudo-classes.
4. Count the number of
element names or pseudo-
elements.
51. A NOTE ON CONCATENATION
“A” will always beat “B”, which will always beat “C”, which
will always beat “D”.
52. STEP 4
If two declarations have the same importance, origin and
specify, the later specified declaration wins.
54. DEFAULTING
When the cascade does not result in a value, the specified
value must be found some other way:
Inherited properties draw their defaults from their
parent element through inheritance.
Other properties take their initial value.
56. EXPLICIT DEFAULTING
Resetting a Property: the initial keyword.
Explicit Inheritance: the inherit keyword.
Erasing All Declarations: the unset keyword.
58. BOX MODEL
The CSS box model describes the rectangular boxes that are
generated for elements in the document tree and laid out
according to the visual formatting model.
62. COLLAPSING MARGINS
In CSS, the adjoining margins of two or more boxes can
combine to form a single margin.
Margins that combine this way are said to collapse, and
the resulting combined margin is called a collapsed
margin.
65. COLLAPSING RESTRICTIONS
Only margins of block-level boxes can collapse.
Margins of a floated box do not collapse with any other
margins.
Margins of a box with ‘overflow’ other than ‘visible’ do not
collapse with its children's margins.
Margins of an absolutely positioned box do not collapse
with any other margins.
Margins of the root element's box do not collapse.
67. VISUAL FORMATTING MODEL
The CSS visual formatting model is the algorithm used to
process a document and display it on a visual media.
68. DEFINING BOXES
box dimensions
box type
the positioning scheme
the other elements in the tree
the viewport size and position
intrinsic dimensions of contained images
other external information
69. BOX GENERATION
The part of the CSS visual formatting model.
Creates boxes from the document's elements.
70. BOX TYPES
Affect how the visual formatting is done.
Depend of the value of the display CSS property.
71. BLOCK-LEVEL ELEMENTS AND
BLOCK BOXES
Visually formatted as a block.
Intended to be vertically stacked.
display: block, list-item, table.
73. BLOCK CONTAINER BOX
Is a box that contains only other block-level boxes, or
creates an inline formatting context.
A block-level box may also be a block container box.
74. BLOCK-LEVEL BOX
how the box will behave with
its parents and sibling
BLOCK CONTAINER
how the box will interact with
its descendants
80. INLINE BOXES
Inline boxes are both inline-level boxes and boxes that
participate in their container's inline formatting context.
81. INLINE BOXES
DIMENSIONS CALCULATION
width
doesn't apply.
height
doesn't apply, but the height of the box is given by the
‘line-height’ property.
padding
only left and right padding will have an effect.
margin
only left and right margin will have an effect.
82. ATOMIC INLINE-LEVEL BOXES
Inline-level boxes that do not participate in an inline
formatting context.
Are never split in several boxes.
Generated by: replaced inline-level elements, by
elements with a calculated display value (inline-
block or inline-table).
83. ATOMIC INLINE-LEVEL BOXES
The text in the span can be
split in several lines as it is an
inline box.
The text in the span
cannot be split in several lines
as it
is an inline-block box.
<style>
span {
display: inline; /* default value*/
color: green;
}
</style>
<div>
The text in the span <span>can be split
in several lines as it</span> is an inline box.
</div>
<style>
span {
display: inlineblock;
color: green;
}
</style>
<div>
The text in the span <span>cannot be split
in several lines as it</span> is an inlineblock box.
</div>
84. ANONYMOUS INLINE BOXES
Any text that is directly contained inside a block container
element (not inside an inline element).
Use the inherit value or the initial value of css properties.
90. NORMAL FLOW
STATIC POSITIONING
The boxes are drawn at the
exact position defined by the
normal flow layout.
RELATIVE POSITIONING
The boxes are drawn with an
offset defined by
the top, bottom, left and right CSS
properties.
91. FLOATS
Floating boxes are positioned at the beginning or end of
the current line.
Anything within the normal flow flows along the edge of
the floating boxes.
93. THE CLEAR CSS PROPERTY
Specifies whether an element can be next
to floating elements that precede it or must be moved
down (cleared) below them.
Applies to both floating and non-floating elements.
94. BLOCK FORMATTING CONTEXT
The region in which:
the layout of block boxes occurs;
floats interact with each other.
95. BLOCK FORMATTING CONTEXT
Created by:
the root element;
floats;
absolutely positioned elements;
inline-blocks;
table cells and table captions;
elements where overflow has a value other
than visible;
flex boxes.
96. ABSOLUTE POSITIONING
Boxes are entirely removed from the flow.
Boxes don't interact with the flow at all.
Boxes positioned relative to their containing block.
97. CONTAINING BLOCK
Element boxes are positioned within a formatting context,
which, by default, is provided by the box generated by a
parent element.
98. CONTAINING BLOCK
POSITION: STATIC OR RELATIVE
The containing block is formed by the edge of the content
box of the nearest ancestor element
whose display property value is one of:
block
inline-block
list-item
run-in
table
table-cell
99. CONTAINING BLOCK
POSITION: ABSOLUTE
The containing block is the nearest positioned ancestor
(the nearest ancestor whose position property has one of
the values absolute, fixed, or relative).
The containing block is formed by the padding edge of
that ancestor.
101. THE STACKING CONTEXT
Boxes are positioned in three dimensions.
The third dimension is the z axis, which is perpendicular
to the screen.
102. 'Z-INDEX' PROPERTY
For a positioned box, the 'z-index' property specifies:
The stack level of the box in the current stacking
context.
Whether the box establishes a local stacking context.
103. FORMING OF A STACKING CONTEXT
The root element (HTML).
Positioned (absolutely or relatively) with a z-index value
other than "auto".
A flex item with a z-index value other than "auto".
Elements with an opacity value less than 1.
Elements with a transform value other than "none".
Elements with a mix-blend-mode value other than
"normal".
Elements with a filter value other than "none".
Elements with isolation set to "isolate".
104. STACKING CONTEXT LAYERS
The background and borders of the element that
establishes the stacking context.
The stacking contexts of descendants with negative stack
levels.
Block-level descendants in the normal flow.
Floated descendants and their contents.
Inline-level descendants in the normal flow.
Positioned descendants whose z-index is auto or 0.
The stacking contexts of descendants with positive stack
levels.
105. STACKING CONTEXT
(SUMMARY)
Positioning and a z-index value creates a stacking
context.
Stacking contexts are hierarchical.
Each stacking context is completely independent from its
siblings.
106. THE GOLDEN RULE OF Z-INDEX
“If you are using 3 digits z-index values, you are doing it
wrong.”
110. @CHARSET
The @charset CSS at-rule specifies the character
encoding used in the style sheet.
This at-rule is useful when using non-ASCII characters in
some CSS properties, like content.
@charset "UTF8";
@charset 'iso885915';
111. @CHARSET
Several ways to define the character encoding of a style
sheet:
The value of the Unicode byte-order character.
The value given by the charset attribute of the
Content-Type: HTTP header.
The @charset CSS at-rule.
The charset attribute of the <link> element. (obsoleted)
The value of the <meta charset> in the document.
112. @IMPORT
Allows to import style rules from other style sheets.
@import 'custom.css';
@import url('landscape.css') screen and (orientation:landscape);
113. @MEDIA
Associates a set of nested statements, in a CSS block that
is delimited by curly braces, with a condition defined by a
media query.
@media <mediaquery> {
/* mediaspecific rules */
}
114. @PAGE
Is used to modify some CSS properties when printing a
document.
@page :first {
margin: 1cm;
}
@page :left {
margin: 1cm 3cm 1cm 1.5cm;
}
@page :right {
margin: 1cm 3cm 1cm 1.5cm;
}
115. @FONT-FACE
Allows authors to specify online fonts to display text on
their web pages.
@fontface {
fontfamily: "Bitstream Vera Serif Bold";
src: url("https://mdn.mozillademos.org/files/2468/VeraSeBd.ttf"
}
117. CSS PROPERTIES
Box Properties
Layout Properties
List Properties
Table Properties
Color and Backgrounds
Typographical Properties
Generated Content
User Interface Properties
Paged Media Properties
136. TEXT-OVERFLOW
One line text that should be…<style>
</style>
<p class="ellipsis">One line text
that should be cut</p>
.ellipses {
overflow: hidden;
whitespace: nowrap;
textoverflow: ellipsis;
}
138. VENDOR-SPECIFIC PROPERTIES
'-' + vendor specific identifier + '-' + meaningful name
Prefix Organisation
-ms- Microsoft
-moz- Mozilla Foundation
(Gecko-based browsers)
-o- Opera Software
-webkit- Safari (and other WebKit-
based browsers)
div {
webkitborderradius: 3px;
mozborderradius: 3px;
borderradius: 3px;
}
140. SHORTHAND PROPERTIES
(EDGE CASES)
A value which is not specified is set to its initial value. (it
overrides previously set values).
div {
backgroundcolor: red;
background: url(images/bg.gif) norepeat top right;
}
141. SHORTHAND PROPERTIES
(EDGE CASES)
Only the individual properties values can inherit.
The keyword inherit can be applied to a property, but only
as a whole, not as a keyword for one value or another.
.parent {
background: red;
}
.child {
background: inherit;
}
142. SHORTHAND PROPERTIES
(EDGE CASES)
Shorthand properties try not to force a specific order for the
values of the properties they replace.
font: [fontstyle||fontvariant||fontweight] fontsize [/lineheight] fontfamily | inherit
div {
font: italic bold 12pt/10pt serif
}
143. SHORTHAND PROPERTIES
(PROPERTIES RELATED TO EDGES OF A BOX)
div {
padding: 10px;
}
div {
padding: 10px 20px;
}
div {
padding: 10px 20px 30px;
}
div {
padding: 10px 20px 30px 40px;
}
144. SHORTHAND PROPERTIES
(PROPERTIES RELATED TO CORNERS OF A BOX)
div {
borderradius: 10px;
}
div {
borderradius: 10px 20px;
}
div {
borderradius: 10px 20px 30px;
}
div {
borderradius: 10px 20px 30px 40px
}
146. UNITS
Unit Description
% percentage
em 1em is equal to the current font size. 2em means 2 times the size of
the current font.
ex one ex is the x-height of a font (x-height is usually about half the
font-size)
px pixels (a dot on the computer screen)
147. UNITS
Unit Description
pt point (1 pt is the same as 1/72 inch)
pc pica (1 pc is the same as 12 points)
in inch
cm centimeter
mm millimeter
148. UNITS RECOMMENDATIONS
Recommended Occasional use Not recommended
Screen em, px, % ex pt, cm, mm, in, pc
Print em, cm, mm, in, pt, pc, % px, ex
149. MORE UNITS IN CSS
Unit Description
rem is the font size of the root element of the
document
vw 1/100th of the window's width
vh 1/100th of the window's height