2013-03-05 51 views
1

是否可以制作圆形导航器? 例如一个圈子分成4个,每个师有不同的链接呢?在html中制作圆形导航器

以及如果有可能我可以把动画放在它们上或当鼠标悬停时改变颜色? TNX ...

+1

你试过什么?显示你的代码... – Rahul 2013-03-05 07:05:41

+0

我havemnt尝试anyhting,但我只是试图搜索谷歌,我似乎无法找到它的啧啧.. – 2013-03-05 11:09:28

回答

3

使用border-radius

HTML

<div id="circle-container"> 
<div class="quarter top-left"><a href="#">link 1</a></div> 
<div class="quarter top-right"><a href="#">link 2</a></div> 
<div class="quarter bottom-left"><a href="#">link 3</a></div> 
<div class="quarter bottom-right"><a href="#">link 4</a></div> 
</div> 

CSS

#circle-container{width:100px;height:100px} 
.quarter{width:50px;height:50px} 
.top-left{border-top-left-radius:50px;background:#e3f9d1;float:left} 
.top-right{border-top-right-radius:50px;background:#c0f7f7;float:right} 
.bottom-left{border-bottom-left-radius:50px;background:#fc92f5;float:left} 
.bottom-right{border-bottom-right-radius:50px;background:#333;float:right} 
a{ 
text-decoration:none; 
    color:red; 
    width:50px; 
    line-height:50px; 
    display:block; 
    text-align:center 
} 

DEMO

+2

你可以使用'overflow:hidden'和'border-radius:50%'on含有元素。 http://jsfiddle.net/fa5Mf/ – Ana 2013-03-05 09:00:05

+0

谢谢,生病之后再尝试,生病了jsut会给你一个upvote回复:D te检查投票以后.. – 2013-03-05 11:10:35

+0

如果圈子分成更多的链接怎么办? – 2013-03-05 11:45:22