
text.align. Diferencia de posición en div y span
Publicado por Ivan Chavarría (14 intervenciones) el 02/01/2018 17:36:50
En el siguiente ejemplo; porque al ponerle al body la propiedad "text-align: center;" el span se corre mas que el div?
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
<!DOCTYPE html>
<html>
<head>
<title>HTML5</title>
<meta charset="utf-8">
<style>
body{
text-align:center;
}
.tooltip{
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
background: yellow;
}
.tooltip .tooltiptext{
background: #000;
color: #fff;
width: 120px;
text-align: center;
position: absolute;
border-radius: 6px;
z-index: 1;
}
</style>
<script>
</script>
</head>
<body>
<div class="tooltip">
Some text...
<span class="tooltiptext">Some text...</span>
</div>
</body>
</html>
Valora esta pregunta


0