[英]CSS3 draw circle in middle of nav with overhand
我不是CSS方面的佼佼者,並且正在尋找類似的方法:
我有一種感覺,我需要使用::after
和content: ' '
來實現這一點以及border-radius: 50%;
.nav { position: fixed; left: 50%; } .nav::after { content: ' Hi '; background-color: rgba(0, 0, 0, 0.5) !important; box-shadow: 0px 1px 8px 1px #222222; border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; position: fixed; height: 7.5em; width: 10em; transform: translateX(-50%); transform: translateY(40%); z-index: 2; }
<div class="nav"></div>
我不相信您可以使用單個HTML元素來實現此效果。 檢查一下,但是:
#outer { width: 300px; height: 225px; background-color:#ccc; position: relative; } #rounded, #leftbox, #rightbox { background-color: #000; opacity: .5; filter: alpha(opacity=50); position: absolute; top: 10px; } #rounded { width: 200px; height: 200px; border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; left: 50px; } #leftbox, #rightbox { width: 50px; height: 100px; } #leftbox { left: 0; } #rightbox { right: 0; }
<div id='outer'> <div id='leftbox'></div> <div id='rounded'></div> <div id='rightbox'></div> </div>
就個人而言,我將使用透明的Image overlay(用於向后兼容)代替此技術。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.