Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Border not appearing continuous

I am trying to make an arc using border-radius like this (in chrome)

#elem {
  border: 2px solid orange;
  border-bottom: none;

  width: 440px;
  height: 60px;
  border-top-right-radius: 220px 60px;
  border-top-left-radius: 222px 60px;
}

but the arc is not continuous. if i remove the border-bottom property (which makes the bottom border also visible) it became continous. Making bottom-border color to transparent also doesn't help.

e.g. http://jsfiddle.net/kFxec/9/

Not able to understand what is wrong here?

I am trying this for chrome only. works fine in firefox

like image 955
Yogesh Khatri Avatar asked Jul 03 '13 14:07

Yogesh Khatri


People also ask

Why is my border not showing up CSS?

CSS Border Not Showing If you've set the shorthand border property in CSS and the border is not showing, the most likely issue is that you did not define the border style. While the border-width and border-color property values can be omitted, the border-style property must be defined. Otherwise, it will not render.

How do you set a border on TR?

Not directly: adding a border to a tr isn't allowed. But you can target the first and last cell, give those a left/right border respectively. Then on each cell put a top border and a bottom border on each td element.


2 Answers

you could instead fake border with box-shadow : http://jsfiddle.net/ZC2m2/

#elem {
  box-shadow:0 -2px 0  orange;
  width: 440px;
  height: 60px;
  border-top-right-radius: 220px 60px;
  border-top-left-radius: 222px 60px;
}
like image 117
G-Cyrillus Avatar answered Nov 11 '22 11:11

G-Cyrillus


I would say that it is some kind of bug. Seems related to the bottom border. It disappears with this CSS

#elem {
  border: 2px solid orange;
  border-bottom: none;

  width: 440px;
  height: 60px;
  border-top-right-radius: 220px 60px;
  border-top-left-radius: 222px 60px;
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}

What you see cutting the top border seems the bottom border doing strange things around. But giving it a moderate radius seems to somehow make it behave. (I don't know why)

fiddle

like image 28
vals Avatar answered Nov 11 '22 13:11

vals