When you set the width and height properties of an element with CSS, you just set the width and height of the content area. To calculate the full size of an element, you must also add padding, borders and margins.
div {
width: 320px;
padding: 10px;
border: 5px solid gray;
margin: 0;
}
Element width = width + left padding + right padding + left border + right border + left margin + right margin = 350px
Element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin
This definition indicates that when the vertical margins of two elements are touching, only the margin of the element with the largest margin value will be honored, while the margin of the element with the smaller margin value will be collapsed to zero
The CSS margin properties define the space around elements.
The CSS padding properties define the space between the element border and the element content.
The CSS border properties allow you to specify the style, size, and color of an element's border
An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
This rule is inserted at the very top of the file and instructs the stylesheet to request and include an external CSS file as if the contents of that file were right where that line is.
This rule contains conditional statements for targeting styles to specific screens. These statements can include screen sizes, which can be useful for adapting styles to devices
Value | Description |
---|---|
all | Used for all media type devices |
Used for printers | |
screen | Used for computer screens, tablets, smart-phones etc. |
speech | Used for screenreaders that "reads" the page out loud |
@media not|only mediatype and (media feature) {
CSS-Code;
}
Mediatypes
Media Features
aspect-ratio | The ratio between the width and the height of the viewport |
---|---|
max-height | The maximum height of the display area, such as a browser window |
max-width | The maximum width of the display area, such as a browser window |
min-height | The minimum height of the display area, such as a browser window |
min-width | The minimum width of the display area, such as a browser window |
orientation | The orientation of the viewport (landscape or portrait mode) |
...
These properties set generated content
The transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, skew, etc., elements.
CSS3 transitions allows you to change property values smoothly (from one value to another), over a given duration.
CSS3 animations allows animation of most HTML elements without using JavaScript or Flash
Create the simmilar page http://codepen.io/NobodyRocks/full/vEKGC
Image with inner shadow
Text with margins and paddings
Add links with vertical lines on right except the last
Use pseudo-elements and pseudo-classes
On hover the line should disappear and the bottom line appears smoothly except the last one
Create this image using gradients and borders
Create this button, pay attention to the shadow. Shadow should appear smoothly
Such text size in normal mode:
This is for mobiles (500px)
Create adaptive text
Create at least three animations
Page loader
Circle bouncing between two blocks
Create infinite animation with the steps: Circle with Gradient => Square => Gradient changing => Size and skew changes => Rotate => Gradient changing => Circle