CSS3边界半径

时间:2015-12-03 01:18:41

标签: css3

http://codepen.io/ZacharyKearns/pen/pgzRmP?editors=010

我正在使用js和css制作一个计算器,并且持有计算器主体的主div具有圆形边缘

#calc {
  background-color: #4CADEC;
  border-radius: 3%;
  height: 500px;
  margin: 200px 300px 400px 225px;
  width: 400px;
}

我试图用不同的背景颜色覆盖主体,用于计算器的屏幕部分

#top {
  background-color: #808080;
  border-radius: 15% 15% 0% 0%;
}

问题是因为顶部元素较小,角部曲线的角度比calc div元素更浅

1 个答案:

答案 0 :(得分:0)

你能简单地使用绝对单位吗?

#calc {
  border-radius: 15px;
}

#top {
  border-radius: 15px;
}

http://codepen.io/anon/pen/XXrPJE?editors=010

相关问题