我正在尝试创建一个在用户滚动时更改位置的小菜单。我为这个风格做了一件事 - http://jsfiddle.net/piedoom/S8tyn/
正如您所看到的,点会附加到每个文本<div>
元素,它看起来像这样。
然而,这看起来非常难看。如何将每个文本div下方的每个点居中?我尝试过像text-align: center
这样的事情无济于事。
答案 0 :(得分:1)
使用margin: auto
的css样式将子div居中。
答案 1 :(得分:0)
只需将你的风格改为下一个
.unselectedcircle
{
background: grey;
position: relative;
top: 32px;
border-radius: 100%;
width: 10px;
height: 10px;
margin: 0 auto;
}
答案 2 :(得分:0)
以下是您的问题的答案: 左侧和左侧边距
.unselectedcircle
{
background: grey;
position: relative;
top: 32px;
border-radius: 100%;
width: 10px;
left:50%;
margin-left:-5px;
height: 10px;
}