Color - Web APIs - MDN Web Docs
Có thể bạn quan tâm
- Skip to main content
- Skip to search
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
The deprecated bgColor property gets or sets the background color of the current document.
In this article
- Value
- Examples
- Notes
- Specifications
- Browser compatibility
Value
A string representing the color as a word (e.g., "red") or hexadecimal value (e.g., "#ff0000").
When set to the null value, that null value is converted to the empty string (""), so document.bgColor = null is equivalent to document.bgColor = "".
Examples
jsdocument.bgColor = "darkblue";Notes
The default value for this property in Firefox is white (#ffffff in hexadecimal).
document.bgColor is deprecated in the HTML specification. The recommended alternative is use of the CSS style background-color which can be accessed through the DOM with document.body.style.backgroundColor.
Specifications
| Specification |
|---|
| HTML# dom-document-bgcolor |
Browser compatibility
Help improve MDN
Was this page helpful to you? Yes No Learn how to contributeThis page was last modified on Jun 6, 2025 by MDN contributors.
View this page on GitHub • Report a problem with this content Filter sidebar- Document Object Model (DOM)
- Document
- Constructor
- Document()
- Instance properties
- activeElement
- activeViewTransition
- adoptedStyleSheets
- alinkColor Deprecated
- all Deprecated
- anchors Deprecated
- applets Deprecated
- bgColor Deprecated
- body
- characterSet
- childElementCount
- children
- compatMode
- contentType
- cookie
- currentScript
- defaultView
- designMode
- dir
- doctype
- documentElement
- documentURI
- domain Deprecated
- embeds
- featurePolicy Experimental
- fgColor Deprecated
- firstElementChild
- fonts
- forms
- fragmentDirective
- fullscreen Deprecated
- fullscreenElement
- fullscreenEnabled
- head
- hidden
- images
- implementation
- lastElementChild
- lastModified
- lastStyleSheetSet Non-standard Deprecated
- linkColor Deprecated
- links
- location
- pictureInPictureElement
- pictureInPictureEnabled
- plugins
- pointerLockElement
- preferredStyleSheetSet Non-standard Deprecated
- prerendering Experimental
- readyState
- referrer
- rootElement Deprecated
- scripts
- scrollingElement
- selectedStyleSheetSet Non-standard Deprecated
- styleSheets
- styleSheetSets Non-standard Deprecated
- timeline
- title
- URL
- visibilityState
- vlinkColor Deprecated
- xmlEncoding Deprecated
- xmlVersion Deprecated
- Static methods
- parseHTML() Experimental
- parseHTMLUnsafe()
- Instance methods
- adoptNode()
- append()
- ariaNotify() Experimental Non-standard
- browsingTopics() Non-standard Deprecated
- caretPositionFromPoint()
- caretRangeFromPoint() Non-standard
- clear() Deprecated
- close()
- createAttribute()
- createAttributeNS()
- createCDATASection()
- createComment()
- createDocumentFragment()
- createElement()
- createElementNS()
- createEvent() Deprecated
- createExpression()
- createNodeIterator()
- createNSResolver() Deprecated
- createProcessingInstruction()
- createRange()
- createTextNode()
- createTouch() Non-standard Deprecated
- createTouchList() Non-standard Deprecated
- createTreeWalker()
- elementFromPoint()
- elementsFromPoint()
- enableStyleSheetsForSet() Non-standard Deprecated
- evaluate()
- execCommand() Deprecated
- exitFullscreen()
- exitPictureInPicture()
- exitPointerLock()
- getAnimations()
- getElementById()
- getElementsByClassName()
- getElementsByName()
- getElementsByTagName()
- getElementsByTagNameNS()
- getSelection()
- hasFocus()
- hasPrivateToken() Experimental
- hasRedemptionRecord() Experimental
- hasStorageAccess()
- hasUnpartitionedCookieAccess()
- importNode()
- moveBefore()
- mozSetImageElement() Non-standard
- open()
- prepend()
- queryCommandEnabled() Non-standard Deprecated
- queryCommandState() Non-standard Deprecated
- queryCommandSupported() Non-standard Deprecated
- querySelector()
- querySelectorAll()
- releaseCapture() Non-standard
- replaceChildren()
- requestStorageAccess()
- requestStorageAccessFor() Experimental
- startViewTransition()
- write() Deprecated
- writeln() Deprecated
- Events
- afterscriptexecute Non-standard Deprecated
- beforescriptexecute Non-standard Deprecated
- DOMContentLoaded
- fullscreenchange
- fullscreenerror
- pointerlockchange
- pointerlockerror
- prerenderingchange Experimental
- readystatechange
- scroll
- scrollend
- scrollsnapchange Experimental
- scrollsnapchanging Experimental
- securitypolicyviolation
- selectionchange
- visibilitychange
- Inheritance
- Node
- EventTarget
- Related pages for DOM
- AbortController
- AbortSignal
- AbstractRange
- Attr
- CDATASection
- CharacterData
- Comment
- CustomEvent
- DOMError Deprecated
- DOMException
- DOMImplementation
- DOMParser
- DOMTokenList
- DocumentFragment
- DocumentType
- Element
- Event
- EventTarget
- HTMLCollection
- MutationObserver
- MutationRecord
- NamedNodeMap
- Node
- NodeIterator
- NodeList
- ProcessingInstruction
- QuotaExceededError Experimental
- Range
- ShadowRoot
- StaticRange
- Text
- TreeWalker
- XMLDocument
- XPathEvaluator
- XPathExpression
- XPathResult
- XSLTProcessor
- Guides
- Anatomy of the DOM
- Attribute reflection
- Selection and traversal on the DOM tree
- Building and updating the DOM tree
- Working with events
Từ khóa » Html De Bgcolor Nedir
-
HTML Body Bgcolor Özelliği | M5 Bilişim
-
HTML ARKAPLAN(bgcolor)RENKLERi-ARKAPLAN RESİM
-
HTML Td Bgcolor Özelliği | M5 Bilişim
-
Html Dersleri - Html Nedir?Html Ile Web Sayfası Nasıl Yapılır?
-
HTML Ile Arka Plan Düzenlemek
-
-
HTML'de Arka Plan Rengi Nasıl Ayarlanır - WikiHow
-
Html Arka Plan Renklendirme (7. Ders Arka Plan Renklendirme)
-
Arkaplan Kullanmak - HTML Dersleri
-
HTML |
Bgcolor Attribute - GeeksforGeeks HTML Renkler Ve Arkaplan Kullanımı | /dev/null Web Günlüğü
Html Arka Plan Renk Kodu
HTML Arka Plan Tasarımı - Kod Kampüsü
CSS Background Color - Murat ÖNER
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu