如何创建具有圆角的锚点?

https://img1.sycdn.imooc.com/6537b1f200017e9f02220066.jpg

我指的锚点在上面

我了解如何创建带有 border-raidus 的圆角,但不像上面的锚点。


ibeautiful
浏览 62回答 1
1回答

猛跑小猪

你必须使用border-radius. 但问题是不使用百分比,而是使用元素高度的一半,px或其他单位,如em或rem。这是一些可以帮助您的示例代码。.anchor {&nbsp; &nbsp; width: 120px;&nbsp; &nbsp; height: 50px;&nbsp; &nbsp; border-radius: 25px;&nbsp; &nbsp; background: red;&nbsp; &nbsp; color: white;&nbsp; &nbsp; display: flex;&nbsp; &nbsp; align-items: center;&nbsp; &nbsp; justify-content: center;}<div class="anchor">Contact</div>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5