A simple example of the CSS animation using 'from' and 'to' keyframes. First, the animation states are being set within the @keyframe attribute. You need to give it a reference name, 'glow' in the example. In the second block the animation is being triggered by calling it's name in the 'animation-name' tag. The animation-duration allows to set the time elapsed between 'from' and 'to' keyframes.
Adds shadow to an element. It uses the following properties - inset (this property is optional and if left out the shadow will appear outside of the element), X axis shadow position, Y axis shadow position, blur value (set to 0 for no blur), spread (how big the shadow is going to appear), color of the shadow.
#css
<style>.element{/* properties: inset(optional) x y blur spread color ;*/box-shadow:2px2px4px2px#CCC;}</style>
Flex direction sets the axis in which the items are positioned. By default it is set to 'row' but optionally 'row-reverse', 'column' or 'column-reverse' can be used.
Flex grow lets you set the relative size of the items. The higher the number used in the flex-grow attribute the larger the item will grow in relation to other elements.
This setting allows you to control the display behaviour of the font. Options - auto, block, swap, fallback, optional.
#css#font
<style>@font-face{/* Declare font settings here, font-family, style, weight, and source *//* Then you can choose from one of the following options */font-display:auto;/* Use default user agent settings */font-display:block;/* This can stop the font flickering but can affect performance */font-display:swap;/* A suggested solution. Good balance between performance and user experience */font-display:fallback;/* Prioritises fallback font over the custom font */font-display:optional;/* This will use the fallback font */}</style>
The inset property shorthand is used to specify top, right, bottom, and left values simultaneously. The values are given in the order top, right, bottom, left, and are separated by spaces.
Set gradient background of the element. The first attribute is for the gradient's angle, choose from "to bottom", "to right", a mixed approach "to bottom left" or a degree value like "-10deg".
#css#background
<style>.element{/* background-image: linear-gradient(direction, color-1, color-2, ...); *//* If the direction isn't set the gradient will be set top to bottom by default. */background-image:linear-gradient(start-color,end-color);/* You can use multiple colors too */background-image:linear-gradient(toleft,#111c3a,#192850);}</style>
This example loads a custom font file. Preload tag ensures the request fetching the resource is raised as soon as possible to improve user experience. In addition, font-display and unicode-range attributes are used to optimise performance.
#css#font
<!--Usepreloadtagintheheadertoprioritisefontrequest--><linkrel="preload"href="path/to/the/Font-File.woff2"as="font"><style>@font-face{font-family:"Font";font-style:normal;font-weight:400;src:url(fonts/Font-File.eot);src:local('Font'),/* Get the local font file if available */url(fonts/Font-File.woff2)format("woff2"),/* Preloaded in the header */url(fonts/Font-File.woff)format("woff"),url(fonts/Font-File.eot#iefix)format("eot");font-display:optional;/* Prevent reflows */unicode-range:U+000-5FF;/* Load Latin glyphs only */}</style>
This pseudo class matches an element that has no children. Whitespace is considered as a child, so if you have an element with a space inside, it will not be considered empty.
Set radial gradient background of the element. The first attribute is to define the shape of the gradient. If not set it will default to an ellipse filling in the background space of the element. The following values are for setting colors of the gradient starting from the inside. You can set multiple colors if you like. The final value defines the size of the effect. Its default value is 100% and it spans from edge to edge of the element.
Scroll snap x lets you set horisontal snapping behaviour of the scrolling element. Choose from mandatory or proximity options for different effects. Make sure you are happy with the browser support for this property before using.
Scroll snap y lets you set vertical snapping behaviour of the scrolling element. Choose from mandatory or proximity options for different effects. Make sure you are happy with the browser support for this property before using.
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Deleniti, optio harum? Eius, deserunt, optio assumenda accusamus error eos quasi commodi consequuntur recusandae sapiente vel itaque aut reiciendis ipsum nesciunt fugit.