Block Element: The block elements always start on a new line. They will also take space for an entire row or width. List of block elements are
#rcorners1 {
border-radius: 25px;
background: #715751;
padding: 20px;
width: 200px;
height: 150px;
}
The border-radius Property
Rounded corners for an element with a specified background color:
Rounded corners!
We can set the image to be used as the border-image alongside an element by using the property of CSS “border-image”.
Example:
#borderimg {
border: 15px solid transparent;
padding: 20px;
border-image: url(border.png) 30 round;
}
It allows you to design a flexible responsive layout structure without using any float or positioning property of CSS. To use CSS flexbox you need to define a flex container initially.
Example:
.flex-container {
display: flex;
background-color: #f4b042;
}
.flex-container > div {
background-color: #d60a33;
margin: 10px;
padding: 20px;
font-size: 30px;
}
Example of flexbox.
In CSS, the margin is the property by which we can create space around elements. We can even create space to the exterior defined borders.
In CSS, we have margin property as follows:
margin-top
margin-right
margin-bottom
Margin-left
Margin property has some defined values as shown below.
Auto – Using this property browser calculates the margin.
Length – It sets the margin values in px,pt,cm etc.
% – It sets the width % of the element.
Inherit – By this property we can inherit the margin property from the parent element.
In CSS, padding is the property by which we can generate space around an element’s content as well as inside any known border.
CSS padding also has properties like,
Padding-top
Padding-right
Padding-bottom
Padding-left
Negative values are not allowed in padding.
div {
padding-top: 60px;
padding-right: 40px;
padding-bottom: 50px;
padding-left: 70px;
}
It is the property that elaborates on the transparency of an element.
By this property, we can transparent the image that can take the values from 0.0-1.0. If the value is lower, then the image is more transparent. IE8 and earlier versions of the browser can take the values from 0-100.
img {
opacity: 0.6;
filter: alpha(opacity=60); /* For IE8 and earlier */}
Important declarations are defined as that declaration which is having more importance than the normal declaration.
While executing, these declarations override the declaration which is having less importance.
For example, if there are two users having an important declaration then one of the declarations will override the declaration of another user.
For Example:
Body {background: #FF00FF !important; color: blue}
In this body, the background has more weight than the color.