CSS Reviewer
CSS Reviewer
• All HTML elements can be considered as boxes. The CSS box model represents the design
and layout of the site. It consists of margins, borders, paddings, and the actual content.
• The properties work in the same order. top, right, bottom, and left. (CLOCKWISE)
• CSS uses the box model to determine how big the boxes are and how to place them.
• It is important to understand how the total width of an element is calculated when working
with boxes.
• The total width of an element is the sum of left and right margins, left and right borders,
left and right paddings, and the actual width of the content.
• The total height of an element is calculated the same way as the width.
• The CSS border property allows you to customize the borders of HTML elements.
• In order to add a border to the element, you need to specify the size, style, and color of the
border.
B. Border Width
• The properties for the border can be set separately. The border-width property specifies
C. Border Color
• The border color of the element can be defined using a color name, RGB, or Hex values. (e.g.
blue, rgb(0, 0, 150), #0000FF)
D. The border-style Property
• There are various styles supported for the border-style property: dotted, dashed, double,
Etc.
• The width and height of an element can be also assigned using percent.
• In the example below the width of an element is assigned in percentages, the height is in
• To set the minimum and maximum height and width of an element, you can use the
following properties:
• The color of the background can be defined using three (3) different formats: a color name,
background image can be repeated along the horizontal axis, the vertical axis, both axes,
CSS3 Properties
I. Linear Gradients
A. Creating Linear Gradients
• CSS gradients enable you to display smooth transitions between two (2) or more specified
colors. CSS defines two (2) types of gradients: Linear and Radial.
(e.g. background:-moz-linear-gradient(DeepSkyBlue, Black); )
B. Color Stops
• Color can be added one (1) after the other, separated by a comma. The browser will then
determine each color stop position.
(e.g. background: linear-gradient(blue, yellow, green, pink, white); )
E. Repeating a Linear-Gradient
• The repeating-linear-gradient() function is used to repeat a linear gradient
(e.g. background: repeating-linear-gradient(blue, green 20px); )
E. Multiple Backgrounds
• The ability to have multiple background images is a new feature in CSS