DEV Community

Priyaramu
Priyaramu

Posted on

CSS Properties

*CSS (Cascading Style Sheets) *
CSS is the language we use to style a Web page.It controls how HTML elements look on the screen, such as colors, fonts, spacing, and positioning. CSS helps separate content from design, making websites easier to manage and visually appealing.

Global selector
The Global selector * means all elements (headings, paragraphs, divs, etc.)It sets the margin and padding of every element to 0.Useful for starting a page with a clean, consistent style.

hr tag
In HTML


means horizontal rule. It is used to draw a horizontal line across the page.Usually, it separates sections or content.

List style type
In CSS, list-style-type is used to change the bullet or numbering style of a list.
Unorder list
ul {
list-style-type: disc; /* default bullet /
}
ul.circle {
list-style-type: circle; /
hollow circle /
}
ul.square {
list-style-type: square; /
square bullet /
}
**Order list
*
ol {
list-style-type: decimal; /* default 1, 2, 3 /
}
ol.upper-roman {
list-style-type: upper-roman; /
I, II, III /
}
ol.lower-alpha {
list-style-type: lower-alpha; /
a, b, c */
}

Border-collapse
border-collapse is a property used with HTML tables to control how the borders of table cells are displayed.

Each cell has its own border
    table {
            border-collapse: separate;
     }

Adjacent cell borders are merged into a single border
    table {
            border-collapse: collapse;
     }
Enter fullscreen mode Exit fullscreen mode

Linear gradient
It is used to create a smooth transition between two or more colors in a straight line.

Why do we use the alt attribute in the image tag?
The alt attribute in the tag is used to provide alternative text for an image.

What is an Attribute?
An attribute is extra information added to an HTML element. In simple terms, an attribute is like a detail or characteristic that tells the browser how the element should behave or appear.
Example: src="dog.jpg" → tells what the image actually is
alt="A cute dog" → describes the image

Element meaning
An HTML element is a basic building block of a web page. It represents a piece of content, such as a heading, paragraph, image, or link.
Most HTML elements have three parts:
1. Opening tag → tells the browser what type of element it is
2. Content → the information inside the element
3. Closing tag → ends the element

Top comments (0)