--- title: background slug: Web/CSS/background translation_of: Web/CSS/background ---
{{CSSRef("CSS Background")}}

background kısayolu arka plan stillerini - örneğin renk, imaj, kaynak ve boyut ya da tekrarlama metodu- tek seferde vermeye yarayan bir CSS özelliğidir.

{{EmbedInteractiveExample("pages/css/background.html")}}

Bu özellik aşağıdaki stilleri tek satırda vermeyi sağlayan bir  shorthand 'dir: {{cssxref("background-clip")}}, {{cssxref("background-color")}}, {{cssxref("background-image")}}, {{cssxref("background-origin")}}, {{cssxref("background-position")}}, {{cssxref("background-repeat")}}, {{cssxref("background-size")}}, ve {{cssxref("background-attachment")}}.

Diğer tüm shorthand özelliklerinde olduğu gibi eklenmemiş tüm stiller ilk değerlerini almaya devam eder.

Syntax

/* Using a <background-color> */
background: green;

/* Using a <bg-image> and <repeat-style> */
background: url("test.jpg") repeat-y;

/* Using a <box> and <background-color> */
background: border-box red;

/* A single image, centered and scaled */
background: no-repeat center/80% url("../img/image.png");

background özelliği bir ya da daha fazla arka plan katmanının virgülle ayrılmış hali olarak tanımlanır.

Her katmanın sentaksı aşağıdaki gibidir:

Values(Değerler)

<attachment>
See {{cssxref("background-attachment")}}
<box>
See {{cssxref("background-clip")}} and {{cssxref("background-origin")}}
<background-color>
See {{cssxref("background-color")}}
<bg-image>
See {{Cssxref("background-image")}}
<position>
See {{cssxref("background-position")}}
<repeat-style>
See {{cssxref("background-repeat")}}
<bg-size>
See {{cssxref("background-size")}}.

Formal syntax

{{csssyntax}}

Örnekler

HTML

<p class="topbanner">
  Starry sky<br/>
  Twinkle twinkle<br/>
  Starry sky
</p>
<p class="warning">Here is a paragraph<p>

CSS

.warning {
  background: pink;
}

.topbanner {
  background: url("https://mdn.mozillademos.org/files/11983/starsolid.gif") #99f repeat-y fixed;
}

Sonuç

{{EmbedLiveSample("Examples")}}

Accessibility concerns

Assistive technology cannot parse background images. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document.

Specifications

Specification Status Comment
{{SpecName('CSS3 Backgrounds', '#the-background', 'background')}} {{Spec2('CSS3 Backgrounds')}} The shorthand property has been extended to support multiple backgrounds and the new {{cssxref("background-size")}}, {{cssxref("background-origin")}} and {{cssxref("background-clip")}} properties.
{{SpecName('CSS2.1', 'colors.html#propdef-background', 'background')}} {{Spec2('CSS2.1')}} No significant changes
{{SpecName('CSS1', '#background', 'background')}} {{Spec2('CSS1')}} Initial definition

{{cssinfo}}

Browser compatibility

{{Compat("css.properties.background")}}

See also