Sep 14, 2024
.html
).<style>
tags in the <head>
section.<body style="background-color: black;">
<h1 style="color: white;">My Website</h1>
<style>
in <head>
:
<style>
body { background-color: black; }
h1 { color: white; }
p { background-color: gray; color: white; }
</style>
style.css
file.<link rel="stylesheet" href="style.css">
#idName
targets an element by its unique ID..className
targets elements with a specific class.border-style
: solid, dashed, dotted, etc.border-width
: specifies size.border-color
: color of the border.border-radius
to round corners.background-color: blue;
background-image: url('image.jpg');
margin: 10px;
(all sides) or margin: 10px 5px;
(top/bottom, left/right).clear
property to stop floating effects.static
, relative
, absolute
, fixed
, sticky
.
:hover
, :active
, :focus
, :nth-child()
.text-shadow: 2px 2px 5px gray;
box-shadow: 5px 5px 5px black;
@keyframes
to create animations.@keyframes myAnimation {
from { opacity: 0; }
to { opacity: 1; }
}