Experiment-2_CSS
Experiment-2_CSS
Data Science
Experiment No. 02
1. Aim: To design a web page using CSS3 with properties and styles.
3. Theory :-
CSS Properties
CSS rules also known as rulesets and are a combination of one or more CSS properties that you can apply
to one or more HTML elements.
It consists of a CSS selector and CSS properties. It determines what to style to a targeted HTML element.
div {
border-color: brown;
font-size: 2rem;
}
Style Images With CSS
Style images with CSS such as adding a border to an image, adjusting its dimensions, and further specific
CSS to our images in the webpage. First, add an image element in the HTML file.
To use the class as a selector while creating a CSS rule, we use the ‘.’ symbol before writing the class
name in the CSS file.
Styling IDs with CSS
Using IDs as selectors while creating CSS rules is similar to using classes as selectors, however, IDs are
unique in the HTML document and no two elements can carry the same IDs. IDs are generally applied to
the elements which are present only one time in the HTML document such as the navbar, logo, and more.
● Content box: It is the space where the content of the HTML element appears, such as images, text, and
more.
● Padding: It is the transparent area around the content of the element.
● Border: It is the box surrounding the padding box. By default, the value of the border for every HTML
element is zero; however, increasing the border value increases the space between the padding and the
margin box.
Result:
Thus, we have studied to design webpage using HTML 5.0 and CSS3.