CSS Attribute Selectors
CSS Attribute Selector:
CSS (Cascading Style Sheets) allows you to control the presentation and styling of HTML elements on a web page. CSS attributes, often referred to as CSS properties, are used to define the visual properties of these elements. Here are some common CSS attributes along with examples:
Color (color):
This property sets the text color of an element.
Font Size (font-size):
Sets the size of the text within an element.
Background Color (background-color):
Defines the background color of an element.
Margin (margin):
Controls the spacing outside an element's border.
Padding (padding):
Sets the spacing between an element's content and its border.
Border (border):
Defines the border around an element.
Text Alignment (text-align):
Adjusts the horizontal alignment of text within an element.
Font Family (font-family):
Specifies the font used for text within an element.
Text Decoration (text-decoration):
Adds decorative effects to text, like underlines or overlines.
Width and Height (width and height):
Sets the dimensions of an element, such as width and height.