diff --git a/css_exclusions/base.css b/css_exclusions/base.css new file mode 100644 index 0000000..0684b98 --- /dev/null +++ b/css_exclusions/base.css @@ -0,0 +1,111 @@ +@charset "UTF-8"; + +/* VARIABLES -------------------------------------------------------------- */ + +:root { + --heading-font: 'Open Sans', sans-serif; + --main-font: 'Open Sans', sans-serif; + --minor-font: 'Open Sans', sans-serif; + --heading-color: rgba(0,0,50,.9); + --main-color: rgba(70,70,90,.9); + --minor-color: rgb(180,180,190); + --emphasis-color: rgb(27,211,165); +} + + + +/* DEFAULTS --------------------------------------------------------------- */ + +html { + font-family: var(--main-font); + font-size: 16px; + font-weight: 400; + line-height: 1.7em; + color: var(--main-color); +} + +h1 { + font-family: var(--heading-font); + font-size: 2.6rem; + font-weight: 300; + line-height: 1.2em; + color: var(--heading-color); + margin: 0 0 25px 0; +} + +p { + margin: 0 0 20px 0; +} + +ul { + list-style-type: none; + padding: 0; + margin: 0 0 20px 0; +} + +/* TYPOGRAPHY ------------------------------------------------------------- */ + +/* LINKS & BUTTONS -------------------------------------------------------- */ + +a:link, +a:visited { + color: var(--minor-color); + text-decoration-skip: edges; +} + +a:hover, +a:active { + color: var(--emphasis-color); +} + + + +/* LAYOUT ----------------------------------------------------------------- */ + +.flexible { + border: solid 2px aquamarine; + min-width: 380px; + max-width: 1400px; + margin: 15px auto; +} + +.fixed { + border: solid 2px aquamarine; + width: 800px; + height: 800px; + margin: 15px auto; +} + +.box { + background: AliceBlue; + padding: 25px; +} + +.box:nth-child(even) { + background: MintCream; +} + +.exclusion_element { + position: absolute; + top: 25%; + left: calc(50% - 100px); + width: 200px; + wrap-flow: both; +} + + + + +/* COMPONENTS ------------------------------------------------------------- */ + +/* COSMETIC --------------------------------------------------------------- */ + +.comment { + color: var(--minor-color); +} + + + +/* UTILITY ---------------------------------------------------------------- */ + +/* STATE ------------------------------------------------------------------ */ diff --git a/css_exclusions/index.html b/css_exclusions/index.html new file mode 100644 index 0000000..938b0cd --- /dev/null +++ b/css_exclusions/index.html @@ -0,0 +1,47 @@ + + + +
+ +wrap-flow: both;
/* creates an exclusion element */
+ CSS exclusions define arbitrary areas around which inline content can flow, and can be defined on any block-level element. An exclusion element is a block-level element which is not a float, and generates an exclusion box. An element becomes an exclusion when its wrap-flow
property is set to something other than its initial value of auto.
Exclusions have to be positioned somehow, using any of the positioning schemes we currently have at our disposal like absolute positioning, grid and so on (but not floats floats).
+ +
+ CSS Exclusions explained by Rachel Andrew
+ CSS Exclusions explained by Chen Hui Jing.
+
There are seven possible values for the wrap-flow
property:
auto
- no exclusion created.both
- inline content can flow on all sides of the exclusion.start
- inline content can only flow around the start edge.end
- inline content can only flow around the end edge.minimum
- inline content can only flow around the edge with least available space.maximum
- inline content can only flow around the edge with most available space.clear
- nothing flows along the start or end edge of the exclusion.With the wrap-through
property, by setting a value of none
, the inline content will flow through the exclusion, as if it wasn’t there to begin with.