DOCUMENTATION CSS - MD
DOCUMENTATION CSS - MD
DMA SYSTEM
Code
css
:root {
--primary-color: #2c3e50;
--secondary-color: #3498db;
--accent-color: #e74c3c;
--text-color: #333;
--text-light: #666;
--bg-light: #f8f9fa;
--white: #ffffff;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
--shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
--transition: all 0.3s ease;
}
Explication
Variables de couleurs :
• --primary-color: #2c3e50;
• --secondary-color: #3498db;
• --accent-color: #e74c3c;
• --text-color: #333;
• --text-light: #666;
• --bg-light: #f8f9fa;
• --white: #ffffff;
• Blanc pur
• Utilisée pour : texte sur fond foncé, cards
• Exemple : background: var(--white);
Variables d'effets :
• --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
2. RESET ET BASE
Code
css
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: var(--text-color);
overflow-x: hidden;
}
img {
max-width: 100%;
height: auto;
display: block;
}
a{
text-decoration: none;
color: inherit;
transition: var(--transition);
}
ul {
list-style: none;
}
Explication
• padding: 0;
• box-sizing: border-box;
css
.box {
width: 200px; /* Largeur totale = 200px */
padding: 20px; /* Inclus dans les 200px */
border: 5px solid; /* Inclus dans les 200px */
}
/* Sans box-sizing: border-box, largeur réelle = 250px */
/* Avec box-sizing: border-box, largeur réelle = 200px */
body { ... }
• font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
• line-height: 1.6;
• color: var(--text-color);
• overflow-x: hidden;
img { ... }
• max-width: 100%;
• height: auto;
• display: block;
a { ... }
• text-decoration: none;
• color: inherit;
• transition: var(--transition);
ul { list-style: none; }
• list-style: none;
3. CONTENEUR PRINCIPAL
Code
css
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
Explication
Propriétés détaillées :
• max-width: 1200px;
• margin: 0 auto;
• padding: 0 20px;
Exemple visuel
4. HEADER (En-tête)
Code
css
header {
background: var(--white);
box-shadow: var(--shadow);
position: sticky;
top: 0;
z-index: 1000;
padding: 1rem 0;
}
header .container {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo h1 {
color: var(--primary-color);
font-size: 1.8rem;
font-weight: 700;
letter-spacing: 1px;
}
.navbar .menu {
display: flex;
gap: 2rem;
}
.navbar .menu li a {
color: var(--text-color);
font-weight: 500;
padding: 0.5rem 1rem;
border-radius: 5px;
transition: var(--transition);
}
Explication détaillée
header { ... }
• background: var(--white);
• box-shadow: var(--shadow);
• position: sticky;
• top: 0;
• z-index: 1000;
• padding: 1rem 0;
• display: flex;
• justify-content: space-between;
[LOGO] [MENU]
• align-items: center;
.logo h1 { ... }
• color: var(--primary-color);
• font-size: 1.8rem;
• font-weight: 700;
• letter-spacing: 1px;
• display: flex;
• Menu horizontal
• gap: 2rem;
• font-weight: 500;
• border-radius: 5px;
• transition: var(--transition);
• color: var(--secondary-color);
• background: var(--bg-light);
┌───────────────────────────────────────────────────────┐
│ [DMA SYSTEM] [Accueil][À propos][Contact] │
│ (sticky) (hover = fond gris) │
└───────────────────────────────────────────────────────┘
↑ ↑
Logo (gauche) Menu (droite)
space-between les sépare
5. SECTION HERO
Code
css
.hero {
padding: 4rem 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: var(--white);
}
.hero-content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
align-items: center;
}
.hero-text .tagline {
font-size: 1.3rem;
line-height: 1.8;
margin-bottom: 2rem;
font-style: italic;
}
.hero-buttons {
display: flex;
gap: 1rem;
margin-bottom: 3rem;
}
.btn {
padding: 0.9rem 2rem;
border-radius: 50px;
font-weight: 600;
display: inline-block;
transition: var(--transition);
text-align: center;
}
.btn-primary {
background: var(--white);
color: var(--primary-color);
}
.btn-primary:hover {
transform: translateY(-3px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.btn-secondary {
background: transparent;
color: var(--white);
border: 2px solid var(--white);
}
.btn-secondary:hover {
background: var(--white);
color: var(--primary-color);
}
.hero-stats {
display: flex;
gap: 2rem;
}
.stat {
display: flex;
flex-direction: column;
}
.stat-number {
font-size: 2rem;
font-weight: 700;
margin-bottom: 0.3rem;
}
.stat-label {
font-size: 0.9rem;
opacity: 0.9;
}
.hero-image img {
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
width: 100%;
max-width: 500px;
height: auto;
object-fit: cover;
}
Explication détaillée
.hero { ... }
• padding: 4rem 0;
• Dégradé de couleur
• 135deg = angle diagonal (du coin sup. gauche au coin inf. droit)
• Exemple visuel :
Violet clair ╲
╲ Transition graduelle
Violet foncé ╲
• color: var(--white);
.hero-content { ... }
• display: grid;
┌─────────────┬─────────────┐
│ Texte │ Image │
│ (1fr) │ (1fr) │
└─────────────┴─────────────┘
• gap: 3rem;
• align-items: center;
• font-size: 1.3rem;
• line-height: 1.8;
• margin-bottom: 2rem;
• font-style: italic;
• Texte en italique
• Donne un aspect "citation" ou "slogan"
.hero-buttons { ... }
• display: flex;
• gap: 1rem;
• margin-bottom: 3rem;
• border-radius: 50px;
• font-weight: 600;
• Semi-gras
• display: inline-block;
• transition: var(--transition);
• text-align: center;
• background: var(--white);
• Fond blanc
• color: var(--primary-color);
• transform: translateY(-3px);
• 25px de flou
• color: var(--white);
• Texte blanc
.btn-secondary:hover { ... }
• background: var(--white);
• color: var(--primary-color);
.hero-stats { ... }
• display: flex;
• gap: 2rem;
.stat { ... }
• display: flex;
• Active Flexbox
• flex-direction: column;
.stat-number { ... }
• font-size: 2rem;
• font-weight: 700;
• margin-bottom: 0.3rem;
.stat-label { ... }
• font-size: 0.9rem;
• opacity: 0.9;
• 40px de flou
• width: 100%;
• max-width: 500px;
• height: auto;
• object-fit: cover;
┌────────────────────────────────────────────────────┐
│ [Fond violet avec dégradé] │
│ │
│ ┌───────────────────┐ ┌──────────────────┐ │
│ │ Tagline italique │ │ │ │
│ │ │ │ [IMAGE] │ │
│ │ [Btn] [Btn] │ │ (arrondie) │ │
│ │ │ │ │ │
│ │ 500+ | 15+ | 98% │ └──────────────────┘ │
│ └───────────────────┘ │
│ 50% 50% │
└────────────────────────────────────────────────────┘
6. SECTION À PROPOS
Code
css
.apropos {
padding: 5rem 0;
background: var(--white);
}
.apropos-content {
display: grid;
grid-template-columns: 1fr 1.5fr;
gap: 3rem;
align-items: center;
}
.apropos-image img {
border-radius: 15px;
box-shadow: var(--shadow);
}
.apropos-text h2 {
color: var(--primary-color);
font-size: 2.2rem;
margin-bottom: 1.5rem;
}
.apropos-text p {
margin-bottom: 1rem;
color: var(--text-light);
line-height: 1.8;
}
.apropos-text strong {
color: var(--primary-color);
font-weight: 600;
}
.apropos-text em {
color: var(--secondary-color);
font-weight: 500;
}
Explication détaillée
.apropos { ... }
• padding: 5rem 0;
• background: var(--white);
• Fond blanc
• Contraste avec la section Hero (violet)
.apropos-content { ... }
• display: grid;
┌──────────┬────────────────────┐
│ Image │ Texte │
│ 40% │ 60% │
└──────────┴────────────────────┘
• gap: 3rem;
• align-items: center;
• box-shadow: var(--shadow);
.apropos-text h2 { ... }
• color: var(--primary-color);
• font-size: 2.2rem;
• margin-bottom: 1.5rem;
.apropos-text p { ... }
• margin-bottom: 1rem;
• color: var(--text-light);
• line-height: 1.8;
• font-weight: 600;
.apropos-text em { ... }
• Sélecteur em = texte en italique dans HTML
• color: var(--secondary-color);
• font-weight: 500;
html
<p >
<strong>Zoya Melouna</strong> est...
<!-- strong = bleu foncé + gras -->
</p>
<p >
Elle pense que : <em>"Tel Tu Penses, Tel Tu Es"</em>
<!-- em = bleu clair + italique -->
</p>
Code
css
.formations,
.livres,
.evenements {
padding: 5rem 0;
}
.formations {
background: var(--bg-light);
}
.livres {
background: var(--white);
}
.evenements {
background: var(--bg-light);
}
.section-title {
text-align: center;
font-size: 2.5rem;
color: var(--primary-color);
margin-bottom: 3rem;
position: relative;
}
.section-title::after {
content: '';
display: block;
width: 80px;
height: 4px;
background: var(--secondary-color);
margin: 1rem auto 0;
border-radius: 2px;
}
.formations-grid,
.livres-grid,
.evenements-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
margin-bottom: 3rem;
}
.formation-card,
.livre-card,
.evenement-card {
background: var(--white);
border-radius: 15px;
overflow: hidden;
box-shadow: var(--shadow);
transition: var(--transition);
}
.formation-card:hover,
.livre-card:hover,
.evenement-card:hover {
transform: translateY(-10px);
box-shadow: var(--shadow-hover);
}
.formation-card img,
.livre-card img,
.evenement-card img {
width: 100%;
height: 250px;
object-fit: cover;
}
.formation-card h3,
.livre-card h3,
.evenement-card h3 {
padding: 1.5rem 1.5rem 0.5rem;
color: var(--primary-color);
font-size: 1.4rem;
}
.formation-card p,
.livre-card p,
.evenement-card p {
padding: 0 1.5rem 1.5rem;
color: var(--text-light);
}
.section-cta {
text-align: center;
}
Explication détaillée
.section-title { ... }
• text-align: center;
• Titre centré
• font-size: 2.5rem;
• color: var(--primary-color);
• Bleu foncé
• margin-bottom: 3rem;
• position: relative;
.section-title::after { ... }
• display: block;
• width: 80px;
• height: 4px;
• background: var(--secondary-color);
• 0 en bas
• border-radius: 2px;
Nos formations
════════════════
──────
(barre bleue)
• Grille CSS
• Comportement :
• Écran 1200px → 3 colonnes (3 × 300px = 900px + gaps)
• Écran 768px → 2 colonnes (2 × 300px = 600px + gap)
• Écran 480px → 1 colonne (300px min)
• gap: 2rem;
• margin-bottom: 3rem;
• background: var(--white);
• border-radius: 15px;
• Coins arrondis
• overflow: hidden;
• box-shadow: var(--shadow);
• Ombre légère
• transition: var(--transition);
• box-shadow: var(--shadow-hover);
• width: 100%;
• height: 250px;
• object-fit: cover;
• 1.5rem en bas
.section-cta { ... }
• text-align: center;
8. SECTION EBOOKS
Code
css
.ebooks {
padding: 5rem 0;
background: var(--white);
}
.ebooks-content {
display: grid;
grid-template-columns: 1fr 1.2fr;
gap: 4rem;
align-items: start;
}
.ebooks-info {
position: sticky;
top: 100px;
}
.badge {
display: inline-block;
background: #e3f2fd;
color: #1976d2;
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.9rem;
font-weight: 600;
margin-bottom: 1.5rem;
}
.ebooks-title {
font-size: 2.5rem;
color: var(--text-color);
margin-bottom: 1.5rem;
line-height: 1.2;
}
.ebooks-title .highlight {
color: #1976d2;
font-weight: 700;
}
.ebooks-description {
color: var(--text-light);
line-height: 1.8;
margin-bottom: 2rem;
}
.ebooks-features {
list-style: none;
margin-bottom: 2rem;
}
.ebooks-features li {
display: flex;
gap: 1rem;
align-items: flex-start;
margin-bottom: 1.5rem;
}
.feature-icon {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
background: #1976d2;
color: white;
border-radius: 50%;
font-size: 0.8rem;
flex-shrink: 0;
}
.ebooks-features li strong {
display: block;
color: var(--text-color);
font-weight: 600;
margin-bottom: 0.2rem;
}
.ebooks-features li p {
color: var(--text-light);
font-size: 0.9rem;
}
.btn-ebook {
display: inline-block;
background: #1976d2;
color: white;
padding: 0.9rem 2rem;
border-radius: 50px;
font-weight: 600;
transition: var(--transition);
}
.btn-ebook:hover {
background: #1565c0;
transform: translateX(5px);
}
.ebooks-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
}
.ebook-card {
background: #f5f5f5;
padding: 2rem;
border-radius: 15px;
transition: var(--transition);
position: relative;
}
.ebook-card:hover {
transform: translateY(-5px);
box-shadow: var(--shadow-hover);
}
.[Link] {
background: #e3f2fd;
}
.[Link] {
background: #f3e5f5;
}
.[Link] {
background: #e8f5e9;
}
.[Link] {
background: #fff3e0;
}
.ebook-icon {
font-size: 2.5rem;
margin-bottom: 1rem;
}
.ebook-card h3 {
font-size: 1.2rem;
color: var(--text-color);
margin-bottom: 0.5rem;
}
.ebook-card p {
color: var(--text-light);
font-size: 0.9rem;
margin-bottom: 1rem;
}
.ebook-price {
display: block;
font-size: 1.5rem;
font-weight: 700;
color: var(--text-color);
}
Explication détaillée
.ebooks-content { ... }
• gap: 4rem;
• align-items: start;
.ebooks-info { ... }
• position: sticky;
• top: 100px;
.badge { ... }
• display: inline-block;
• background: #e3f2fd;
• color: #1976d2;
• border-radius: 20px;
• font-size: 0.9rem;
• font-weight: 600;
• Semi-gras
• margin-bottom: 1.5rem;
• Espace en bas
• color: #1976d2;
• font-weight: 700;
html
<h2 class="ebooks-title">
Découvrez nos <span class="highlight">eBooks</span>
</h2>
<!-- "Découvrez nos" en noir, "eBooks" en bleu -->
.feature-icon { ... }
• display: flex;
• Active Flexbox
• background: #1976d2;
• Fond bleu
• color: white;
• Icône blanche
• border-radius: 50%;
• font-size: 0.8rem;
• Petit symbole ✓
• flex-shrink: 0;
flex-shrink expliqué
.btn-ebook:hover { ... }
• transform: translateX(5px);
.ebooks-grid { ... }
• grid-template-columns: repeat(2, 1fr);
html
.ebook-price { ... }
• display: block;
• font-size: 1.5rem;
• font-weight: 700;
• Très gras
9. SECTION TÉMOIGNAGES
Code
css
.testimonials {
padding: 5rem 0;
background: var(--white);
}
.testimonials-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.testimonial-card {
background: var(--bg-light);
padding: 2rem;
border-radius: 15px;
border-left: 4px solid var(--secondary-color);
transition: var(--transition);
}
.testimonial-card:hover {
transform: translateX(10px);
box-shadow: var(--shadow);
}
.testimonial-text {
font-size: 1.1rem;
font-style: italic;
color: var(--text-color);
margin-bottom: 1rem;
line-height: 1.8;
}
.testimonial-author {
color: var(--secondary-color);
font-weight: 600;
text-align: right;
}
Explication détaillée
.testimonial-card { ... }
• background: var(--bg-light);
• padding: 2rem;
• border-radius: 15px;
• Coins arrondis
• 4px = épaisseur
┌────────────────────┐
┃ "Excellent service │ ← Bordure bleue 4px
┃ et accompagnement │ à gauche seulement
┃ personnalisé!" │
┃ │
┃ - Client 1 │
└────────────────────┘
.testimonial-card:hover { ... }
• transform: translateX(10px);
• box-shadow: var(--shadow);
.testimonial-text { ... }
• font-size: 1.1rem;
• font-style: italic;
• line-height: 1.8;
.testimonial-author { ... }
• color: var(--secondary-color);
• Nom en bleu
• font-weight: 600;
• Semi-gras
• text-align: right;
• Aligné à droite
• Style "signature"
Code
css
footer {
background: var(--primary-color);
color: var(--white);
padding: 3rem 0 1rem;
}
.footer-content {
display: grid;
grid-template-columns: 2fr 1fr 1fr;
gap: 3rem;
margin-bottom: 2rem;
}
.footer-about h3 {
font-size: 1.8rem;
margin-bottom: 1rem;
}
.footer-about p {
line-height: 1.8;
opacity: 0.9;
}
.footer-links h4 {
font-size: 1.2rem;
margin-bottom: 1rem;
color: var(--secondary-color);
}
.footer-links ul li {
margin-bottom: 0.5rem;
}
.footer-links ul li a {
opacity: 0.8;
transition: var(--transition);
}
.footer-links ul li a:hover {
opacity: 1;
padding-left: 5px;
}
.footer-bottom {
text-align: center;
padding-top: 2rem;
border-top: 1px solid rgba(255, 255, 255, 0.1);
opacity: 0.8;
}
Explication détaillée
footer { ... }
• background: var(--primary-color);
• color: var(--white);
.footer-content { ... }
┌──────────────────────┬──────────┬──────────┐
│ DMA SYSTEM │ Nav │ Services │
│ Description... │ Accueil │ Form. │
│ (50%) │ Contact │ Livres │
│ │ (25%) │ (25%) │
└──────────────────────┴──────────┴──────────┘
.footer-about p { ... }
• opacity: 0.9;
.footer-links h4 { ... }
• color: var(--secondary-color);
.footer-links ul li a { ... }
• opacity: 0.8;
• opacity: 1;
• padding-left: 5px;
.footer-bottom { ... }
• border-top: 1px solid rgba(255, 255, 255, 0.1);
• padding-top: 2rem;
• opacity: 0.8;
Code
css
.hero-image img {
margin: 0 auto;
}
.hero-stats {
justify-content: center;
}
.hero-buttons {
justify-content: center;
}
.footer-content {
grid-template-columns: 1fr;
text-align: center;
}
.ebooks-content {
grid-template-columns: 1fr;
gap: 3rem;
}
.ebooks-info {
position: static;
}
}
.navbar .menu {
flex-wrap: wrap;
justify-content: center;
gap: 0.5rem;
}
.navbar .menu li a {
font-size: 0.9rem;
padding: 0.5rem 0.8rem;
}
.hero {
padding: 2rem 0;
}
.hero-text .tagline {
font-size: 1.1rem;
}
.section-title {
font-size: 2rem;
}
.hero-stats {
flex-direction: column;
gap: 1rem;
}
.formations-grid,
.livres-grid,
.evenements-grid,
.testimonials-grid {
grid-template-columns: 1fr;
}
.ebooks-grid {
grid-template-columns: 1fr;
}
.ebooks-title {
font-size: 2rem;
}
}
.btn {
width: 100%;
}
}
Explication détaillée
css
• De 2 colonnes → 1 colonne
• Sur tablette, pas assez de place pour 2 colonnes
• Empilage vertical
• text-align: center;
• Menu centré
Tablette : Mobile :
[Btn1] [Btn2] [ Button 1 ]
[ Button 2 ]
2. Flexbox vs Grid
css
display: flex;
justify-content: space-between; /* Horizontal */
align-items: center; /* Vertical */
css
display: grid;
grid-template-columns: 1fr 1fr; /* Colonnes */
grid-template-rows: auto auto; /* Lignes */
3. Pseudo-classes et Pseudo-éléments
Pseudo-classe (état) :
css
a:hover { } /* Au survol */
a:active { } /* Au clic */
a:focus { } /* Au focus */
Pseudo-élément (contenu) :
css
4. Units (Unités)
Unité Type Exemple Signification
5. Position
Valeur Comportement
6. Z-index (Empilement)
css
Texte :
━━━━━━━
#333 ████ Texte principal
#666 ████ Texte secondaire
Fonds :
━━━━━━
#f8f9fa ████ Fond clair
#ffffff ████ Blanc
eBooks :
━━━━━━━━
#e3f2fd ████ Bleu clair
#f3e5f5 ████ Violet clair
#e8f5e9 ████ Vert clair
#fff3e0 ████ Orange clair
FIN DE LA DOCUMENTATION
Cette documentation couvre l'intégralité du fichier CSS créé pour le site DMA SYSTEM.
Chaque propriété, valeur et concept a été expliqué en détail avec des exemples visuels.