前两天想给博客上添个书签效果,类似于下面这样: 在网上搜索一番后,发现一篇纯css书签导航按钮用三个div实现了这个效果.但是博客园可没有给我这么多div,所以试着用伪类实现了一下. before,after伪类 这两个属性就像正常元素的小左和小右.他们没有元素标签,但是却有元素的css属性,除此之外,他们还有一个特殊的属性叫'content',用来放置文本内容.他们虽然叫before和after,但是跟元素却不是兄弟关系,而是被浏览器当成元素的子元素进行布局.有下图为证. 所以在一个空的div