Source Code:
(back to article)
Submit
Result:
Report an issue
99
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
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
<!DOCTYPE html>
<
html
>
<
head
>
<
style
>
div
{
clear:
both
;
content:
" "
;
display:
table
;
}
span
{
display:
inline-block
;
width:
150
px
;
font-size:
18
px
;
padding:
10
px
15
px
;
text-align:
center
;
color:
#eeeeee
;
float:
left
;
}
span
:
nth-child
(
1
) {
background:
#1c87c9
;
}
span
:
nth-child
(
2
) {
background:
#666666
;
}
span
:
nth-child
(
3
) {
background:
#8ebf42
;
}
</
style
>
</
head
>
<
body
>
<
div
>
<
span
>Élément 1</
span
>
<
span
>Élément2</
span
>
<
span
>Élément 3</
span
>
</
div
>
<
p
>Un texte</
p
>
<!DOCTYPE html> <html> <head> <style> div { clear: both; content: " "; display: table; } span { display: inline-block; width: 150px; font-size: 18px; padding: 10px 15px; text-align: center; color: #eeeeee; float: left; } span:nth-child(1) { background: #1c87c9; } span:nth-child(2) { background: #666666; } span:nth-child(3) { background: #8ebf42; } </style> </head> <body> <div> <span>Élément 1</span> <span>Élément2</span> <span>Élément 3</span> </div> <p>Un texte</p> </body> </html>