Css Commands
Css Commands
font-family: Specifies the font style (e.g., Arial, Times New Roman).
font-weight: Makes text bold (normal, bold, lighter, numeric values like
100, 400).
2. Background Styling
border: Sets the border for an element (border: 2px solid black;).
border-style: Defines the border type (solid, dotted, dashed, double, none).
codes implementation:
html
html
<style>
body {
background-color: lightblue;
</style>
HTML File:
html
css
Copy code
body {
background-color: lightblue;
1. CSS Selectors
css
*{
margin: 0;
padding: 0;
Tag Selector:
css
p{
color: blue;
Class Selector:
css
.highlight {
background-color: yellow;
ID Selector:
css
#main {
font-size: 20px;
2. Colors
css
Copy code
h1 {
color: red;
css
Copy code
body {
background-color: lightgray;
3. Fonts
Font size:
css
Copy code
p{
font-size: 16px;
Font family:
css
Copy code
body {
4. Text Styling
Center-align text:
css
h1 {
text-align: center;
css
strong {
font-weight: bold;
Add a border:
css
div {
Add padding:
css
div {
padding: 10px;
}
6. Margins
css
h2 {
margin: 20px;
7. Hover Effects
css
a:hover {
color: green;
8. Background Images
css
body {
background-image: url('background.jpg');
background-size: cover;
}