From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/pt-br/web/css/border-radius/index.html | 332 +++++++++++++++++++++++++++ 1 file changed, 332 insertions(+) create mode 100644 files/pt-br/web/css/border-radius/index.html (limited to 'files/pt-br/web/css/border-radius/index.html') diff --git a/files/pt-br/web/css/border-radius/index.html b/files/pt-br/web/css/border-radius/index.html new file mode 100644 index 0000000000..1c71af8e01 --- /dev/null +++ b/files/pt-br/web/css/border-radius/index.html @@ -0,0 +1,332 @@ +--- +title: border-radius +slug: Web/CSS/border-radius +tags: + - CSS + - border-radius +translation_of: Web/CSS/border-radius +--- +
{{CSSRef}}
+ +

Sumário

+ +

A propriedade CSS border-radius permite definir como bordas arredondadas são. A curva de cada esquina é definida usando um ou dois raios, definindo sua forma: círculo ou elipse.

+ +

Imagens das esquinas arredondadas com CSS3: Sem esquina arredondada, arredondado usando um arco de círculo, arredondado usando um arco de elípse

+ +

O raio é aplicável a todo o {{Cssxref("background")}}, mesmo se o elemento não tiver borda; a posição exata do recorte é definido pela propriedade {{Cssxref("background-clip")}}.

+ +

Esta propriedade é um shorthand para definir as quatro propriedades {{Cssxref("border-top-left-radius")}}, {{Cssxref("border-top-right-radius")}}, {{Cssxref("border-bottom-right-radius")}} e {{Cssxref("border-bottom-left-radius")}}.

+ +
Como com qualquer propriedade shorthand, valores individuais herdados não são possíveis, isto é, border-radius: 0 0 inherit inherit, que substituiria definições parciais existentes. Neste caso, a propriedade individual longhand deve ser usada.
+ +

{{cssinfo}}

+ +

Sintaxe

+ +
/* A sintaxe do primeiro raio permite de um a quatro valores */
+/* O raio é definido para todos os 4 lados */
+border-radius: 10px;
+
+/* top-left-and-bottom-right | top-right-and-bottom-left */
+border-radius: 10px 5%;
+
+/* top-left | top-right-and-bottom-left | bottom-right */
+border-radius: 2px 4px 2px;
+
+/* top-left | top-right | bottom-right | bottom-left */
+border-radius: 1px 0 3px 4px;
+
+/* A sintaxe do segundo raio permite de um a quatro valores */
+/* (first radius values) / radius */
+border-radius: 10px 5% / 20px;
+
+/* (first radius values) / top-left-and-bottom-right | top-right-and-bottom-left */
+border-radius: 10px 5% / 20px 30px;
+
+/* (first radius values) / top-left | top-right-and-bottom-left | bottom-right */
+border-radius: 10px 5px 2em / 20px 25px 30%;
+
+/* (first radius values) / top-left | top-right | bottom-right | bottom-left */
+border-radius: 10px 5% / 20px 25em 30px 35em;
+
+border-radius: inherit;
+
+ +

Valores

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
radiusall-corner.pngIs a {{cssxref("<length>")}} or a {{cssxref("<percentage>")}} denoting a radius to use for the border in each corner of the border. It is used only in the one-value syntax.
top-left-and-bottom-righttop-left-bottom-right.pngIs a {{cssxref("<length>")}} or a {{cssxref("<percentage>")}} denoting a radius to use for the border in the top-left and bottom-right corners of the element's box. It is used only in the two-value syntax.
top-right-and-bottom-lefttop-right-bottom-left.pngIs a {{cssxref("<length>")}} or a {{cssxref("<percentage>")}} denoting a radius to use for the border in the top-right and bottom-left corners of the element's box. It is used only in the two- and three-value syntaxes.
top-lefttop-left.pngIs a {{cssxref("<length>")}} or a {{cssxref("<percentage>")}} denoting a radius to use for the border in the top-left corner of the element's box. It is used only in the three- and four-value syntaxes.
top-righttop-right.pngIs a {{cssxref("<length>")}} or a {{cssxref("<percentage>")}} denoting a radius to use for the border in the top-right corner of the element's box. It is used only in the four-value syntax.
bottom-rightbottom-rigth.pngIs a {{cssxref("<length>")}} or a {{cssxref("<percentage>")}} denoting a radius to use for the border in the bottom-right corner of the element's box. It is used only in the three- and four-value syntaxes.
bottom-leftbottom-left.pngIs a {{cssxref("<length>")}} or a {{cssxref("<percentage>")}} denoting a radius to use for the border in the bottom-left corner of the element's box. It is used only in the four-value syntax.
inherit Is a keyword indicating that all four values are inherited from their parent's element calculated value.
+ +
+
<length>
+
Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipsis. It can be expressed in any unit allowed by the CSS {{cssxref("<length>")}} data types. Negative values are invalid.
+
<percentage>
+
Denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipsis, using percentage values. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.
+
+ +

For example:

+ +
border-radius: 1em/5em;
+
+/* is equivalent to */
+
+border-top-left-radius:     1em 5em;
+border-top-right-radius:    1em 5em;
+border-bottom-right-radius: 1em 5em;
+border-bottom-left-radius:  1em 5em;
+
+ +
border-radius: 4px 3px 6px / 2px 4px;
+
+/* is equivalent to: */
+
+border-top-left-radius:     4px 2px;
+border-top-right-radius:    3px 4px;
+border-bottom-right-radius: 6px 2px;
+border-bottom-left-radius:  3px 4px;
+
+ +

Sintaxe formal

+ +
{{csssyntax}}
+ +

Examples

+ +
  border: solid 10px;
+  /* the border will curve into a 'D' */
+  border-radius: 10px 40px 40px 10px;
+
+
+ +
  border: groove 1em red;
+  border-radius: 2em;
+
+ +
  background: gold;
+  border: ridge gold;
+  border-radius: 13em/3em;
+
+ +
  border: none;
+  border-radius: 40px 10px;
+
+ +
  border: none;
+  border-radius: 50%;
+
+ +

Live Samples

+ +

Sample 1 : http://jsfiddle.net/Tripad/qnGKj/2/

+ +

Sample 2 : http://jsfiddle.net/Tripad/qnGKj/3/

+ +

Sample 3 : http://jsfiddle.net/Tripad/qnGKj/4/

+ +

Sample 4 : http://jsfiddle.net/Tripad/qnGKj/5/

+ +

Sample 5 : http://jsfiddle.net/Tripad/qnGKj/6/

+ +

Notas

+ + + +

Especificações

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS3 Backgrounds', '#border-radius', 'border-radius')}}{{Spec2('CSS3 Backgrounds')}}Initial definition
+ +

Compatibilidade

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic support +

{{CompatGeckoDesktop("1.0")}}{{property_prefix("-moz")}}[1]
+ {{CompatGeckoDesktop("2.0")}}[10]

+
1.0{{property_prefix("-webkit")}}
+ 4.0[9]
9.010.5[8]3.0{{property_prefix("-webkit")}}
+ 5.0[9]
Elliptical borders{{CompatGeckoDesktop("1.9.1")}}{{CompatVersionUnknown}}[7]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}[7]
4 values for 4 corners{{CompatVersionUnknown}}4.0[6]{{CompatVersionUnknown}}{{CompatVersionUnknown}}5.0[6]
Percentages{{CompatVersionUnknown}}[5]
+ {{CompatGeckoDesktop("2.0")}}
{{CompatVersionUnknown}}[2]{{CompatVersionUnknown}}11.5[3]5.1[2]
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureFirefox Mobile (Gecko)iOS SafariOpera MiniOpera MobileAndroid Browser
Basic support{{CompatVersionUnknown}}[10]3.2{{property_prefix("-webkit")}}{{CompatNo}}{{CompatNo}}2.1{{property_prefix("-webkit")}}
Elliptical borders{{CompatVersionUnknown}}[10]{{CompatUnknown}}{{CompatNo}}{{CompatNo}}{{CompatUnknown}}
4 values for 4 corners{{CompatVersionUnknown}}[10]{{CompatUnknown}}{{CompatNo}}{{CompatNo}}{{CompatUnknown}}
Percentages{{CompatVersionUnknown}}[10]{{CompatVersionUnknown}}[4]{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}}[4]
+
+ +

[1] In Gecko 2.0 {{geckoRelease("2.0")}} -moz-border-radius was renamed to border-radius; -moz-border-radius was supported as an alias until Gecko 12.0 {{geckoRelease("12.0")}}. In order to conform to the CSS3 standard, Gecko 2.0 changes the handling of {{cssxref("<percentage>")}} values to match the specification. You can specify an ellipse as border on an arbitrary sized element just with border-radius: 50%;. Gecko 2.0 also makes rounded corners clip content and images (if {{cssxref("overflow")}}: visible is not set)

+ +

Support for the prefixed version (-moz-border-radius) was removed in Gecko 13.0 {{geckoRelease("13.0")}}.

+ +

[2] <percentage> values are not supported in older Chrome and Safari versions (it was fixed in Sepember 2010).

+ +

[3] The implementation of <percentage> values was buggy in Opera prior to 11.50.

+ +

[4] <percentage> values are not supported in iOS versions prior to 5 and Android versions prior to WebKit 532.

+ +

[5] <percentage> values are implemented in a non-standard way prior to Gecko 2.0. Both horizontal and vertical radii were relative to the width of the border box.

+ +

[6] Safari and Chrome versions prior to WebKit 532.5 support only one value for all four corners. For different radii the {{cssxref("border-top-left-radius", "border-top-left-radius", "#Examples")}} long form properties must be used.

+ +

[7] Safari and Chrome versions prior to WebKit 532.5 don't support the slash / notation. If two values are specified, an elliptical border is drawn on all four corners. -webkit-border-radius: 40px 10px; is equivalent to border-radius: 40px/10px;.

+ +

[8] In Opera prior to version 11.60, applying border-radius to replaced elements will not have rounded corners.

+ +

[9] Current Chrome and Safari versions ignore {{cssxref("border-radius")}} on {{HTMLElement("select")}} elements unless {{cssxref("-webkit-appearance")}} is overridden to an appropriate value.

+ +

[10] Prior to Gecko 50.0 {{geckoRelease("50.0")}}, border styles of rounded corners (with {{cssxref("border-radius")}}) were always rendered as if border-style was solid. This has been fixed in Gecko 50.0.

+ +

In addition to the unprefixed support, Gecko 44.0 {{geckoRelease("44.0")}} added support for a -webkit prefixed version of the property for web compatibility reasons behind the preference layout.css.prefixes.webkit, defaulting to false. Since Gecko 49.0 {{geckoRelease("49.0")}} the preference defaults to true.

+ +

Veja também

+ + -- cgit v1.2.3-54-g00ecf