Bonjour,
j'ai 2 div imbriquées avec à chacune une classe CSS appliquée ; je me suis donc dit qu'une seule div à laquelle on applique les 2 classes CSS revient au même ; mais non et je ne comprends pas pourquoi. Voici les 2 codes :
- 2 div :
- une seule div :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>test rounded corners</title> <style> body { background-color: #fff; font: normal 11pt Trebuchet MS,Arial,sans-serif; } .box1 { background-color: #f0f0f0; width: 150px; height: 20px; padding-left:20px; border: 1px solid #d7d7d7; -moz-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 3px; behavior: url(border-radius.htc); margin: 150px 0 0 33px; padding: 25px; position: relative; z-index: inherit; zoom: 1; } .rel { margin: 150px 0 0 33px; padding: 25px; position: relative; z-index: inherit; zoom: 1; } </style> </head> <div class="rel"> <div class="box1"> test rounded corners </div> </div> </body> </html>
Quelqu'un comprend-il ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>test rounded corners</title> <style> body { background-color: #fff; font: normal 11pt Trebuchet MS,Arial,sans-serif; } .box1 { background-color: #f0f0f0; width: 150px; height: 20px; padding-left:20px; border: 1px solid #d7d7d7; -moz-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 3px; behavior: url(border-radius.htc); margin: 150px 0 0 33px; padding: 25px; position: relative; z-index: inherit; zoom: 1; } .rel { margin: 150px 0 0 33px; padding: 25px; position: relative; z-index: inherit; zoom: 1; } </style> </head> <body> <div class="rel box1"> test rounded corners </div> </body> </html>
Partager