简体   繁体   English

在div底端半圆?

[英]Semi-circle on the bottom side of a div?

I need a semi-circle for the bottom border of a div (not rounded corners), like this. 我需要一个半圆作为div的底边框(不是圆角),像这样。

在此处输入图片说明

This is the div code: 这是div代码:

#navlogo img {
position:fixed;
width: 180px;
height: 180px;
z-index: 2;
left:45%;
top:0;
background-color:#CCC;

Any help is greatly appreciated! 任何帮助是极大的赞赏!

border-radius does the trick, sorry for not wording it better border-radius可以解决问题,对不起,措辞不好

You'll need border-bottom-left-radius: 50% and border-bottom-right-radius: 50%; 您需要border-bottom-left-radius: 50%border-bottom-right-radius: 50%; .

jsFiddle: https://jsfiddle.net/ufar4mrj/ jsFiddle: https ://jsfiddle.net/ufar4mrj/

As far as I know, there are only few ways to include rounded shapes in a webpage: 据我所知,只有很少的方法可以在网页中包含圆形:

  • border-radius (rounded corners) 边界半径(圆角)
  • images 图片
  • SVG SVG
  • Flash

Considering what you want to do, SVG and Flash are out of question, leaving only images and rounded corners to you. 考虑到您想做什么,SVG和Flash毫无疑问,只剩下图像和圆角。 I don't know why you refuse to use border-radius because it works very well. 我不知道您为什么拒绝使用border-radius,因为它可以很好地工作。 You won't find anything that integrates better into a webpage. 您找不到任何可以更好地集成到网页中的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM