Bakgrund färg html
För att lägga till bakgrundsfärg i HTML, använder du CSS-egenskapen background-color. Ställ in det till det färgnamn eller den färgkod du vill ha och placera det i ett stilattribut. Lägg sedan till stilattributet i ett HTML-element, en tabell, rubrik, div- eller span-tagg. W3Schools offers a wide range of services and products for beginners and professionals, helping millions of people everyday to learn and master new skills.
Create your own website with W3Schools Spaces - no setup required. Host your own website, and share it to the world with W3Schools Spaces. Build fast and responsive sites using our free W3. CSS framework. W3Schools Coding Game! Help the lynx collect pine cones. About sales: sales w3schools. The background-color property specifies the background color of an element. It can take a value from 0. The lower value, the more transparent:.
Note: When using the opacity property to add transparency to the background of an element, all of its child elements inherit the same transparency. This can make the text inside a fully transparent element hard to read. If you do not want to apply opacity to child elements, like in our example above, use RGBA color values. The following example sets the opacity for the background color and not the text:. An RGBA color value is specified with: rgba red, green, blue, alpha.
The alpha parameter is a number between 0. If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales w3schools.
How to set background color in HTML
If you want to report an error, or if you want to make a suggestion, send us an e-mail: help w3schools. Search field. My W3Schools Tutorials. Tutorials filter input ×. Backend Learn Python Tutorial Reference. Excercises filter input ×. What is an Exercise? What is a Quiz? Backend Python Exercise Quiz.
Filter field for certifications ×. What is a Certificate? Programs Full Access Best Value! Backend Python Certificate Course. All Our Services. Services filter input ×. Free Tutorials Enjoy our free tutorials like millions of other internet users since References Explore our selection of references covering all popular coding languages. Exercises Test your skills with different exercises. Quizzes Test yourself with multiple choice questions.
HTML Background Color – Change BG Color Tutorial
Get Certified Document your knowledge. Where To Start Not sure where you want to start? Follow our guided path. Code Editor Try it With our online code editor, you can edit code and view the result in your browser. Templates We have created a bunch of responsive website templates you can use - for free! Browser Statistics Read long term trends of browser usage.