我想用css创建效果 - 我想要三个看起来像维恩图的重叠圆圈。我想在圆上应用css-animation变换,使它们看起来像跳动一样。用css创建和定位维恩图
我正在尝试使用·
或·作为维恩图圆。然而,正如你可以(希望)看到的那样,这个角色的位置并不是向左或向右平移......因此定位它非常困难。请注意,在下面的图片中,点在100px x 100px的边界框之外。
我想了维恩图的圈定位到它们的父元素,所以很容易在维恩图元素别处定位。有没有一种更好的方法来创建这种外观?自定义字体? SVG?
<style>
@-webkit-keyframes dot1
{
0% {color: rgba(255, 0, 0, .3);}
50% {color: rgba(255, 0, 0, .8);}
100% {color: rgba(255, 0, 0, .3);}
}
.dot
{
font-size: 200px;
position: absolute;
}
.dot1
{
-webkit-animation:dot1 2s infinite;
top: 0;
}
.dot2
{
-webkit-animation:dot1 2s infinite;
left: 20px;
top: 0;
}
.dot3
{
-webkit-animation:dot1 2s infinite;
top: 10px;
left: 15px;
}
.container
{
border-style: solid;
border-color: pink;
border-width: 1px;
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div class='container'>
<span class='dot dot1'>·</span>
<span class='dot dot2'>·</span>
<span class='dot dot3'>·</span>
</div>
</body>
http://jsbin.com/ozeham/1/edit
不同的浏览器可以呈现不同的方式文本。使用图像可能是最精确的像素方法。但是,尝试使用'.dot'的'line-height'属性。 http://jsbin.com/oparic/1/edit – showdev