css实现小圆点

html-css016

css实现小圆点,第1张

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title></title>

<style type="text/css">

.redcircle {undefined

position: absolute

margin: 52px 45px

width: 12px

height: 12px

background: #FF0000

border-radius: 50%

border: 1px solid #FF6347

}

.greencircle {undefined

position: absolute

margin: 52px 45px

width: 12px

height: 12px

background: #228B22

border-radius: 50%

border: 1px solid #3CB371

}

</html>

其实我就想实现未点击按钮时,文字右上方有小圆点,点击后消失的效果

但是不想用浮动、定位,结果百度搜了一圈,大家都是用浮动、定位解决,

记录两种更好的解决方案:

1.使用sup标签

2.使用css属性vertical-align

啥点点点?是指文字超长显示的...吗?

如果是的话,可以这样

div{

height: 32px

width:100px

overflow: hidden

text-overflow: ellipsis

}

具体数值按实际情况来