


This article uses HTML code and CSS style code to show you how to set the background color of HTML. There is also an introduction on how to set background image later. I hope it will be helpful to everyone, let’s take a look at this article now
First of all, let’s take a look at setting the background color in HTML:
us First, set a background color. Set the background color in the body tag and let's see the effect:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>PHP中文网</title> </head> <body bgcolor="black"> 这是PHP中文网 </body> </html>
The background color is set to black. Can you think of the effect of displaying it in the browser?
Yes, this is the effect. Nothing can be seen. Let’s see if we can set the font to a color and see if it can be displayed:
<body bgcolor="black"> <p>这是<font color="#E41316">PHP中文网</font></p> </body>
Now let’s take a look at the effect:
Is it obvious that adding a color to the font can display the text, but there are still two words that have not been added color, so it still cannot be displayed.
Now let’s take a look at how to create a text background:
<body bgcolor="black"> <p style="background-color: #E12125">这是PHP中文网</p> </body>
The font tag no longer works at this time, so we decisively use css styles to change it. Background color, as you can see, this is a simple css style that only sets a background color.
Let’s take a look at the effect displayed in the browser:
Of course, you can also use pictures as background images. Let’s take a look at the effect examples:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>PHP中文网</title> </head> <body style="background-image: url(https://img.php.cn/upload/article/000/000/003/5a9675a3b2106284.jpg)"> <p>这是PHP中文网</p> </body> </html>This is a picture copied from the Internet, and the effect is still very good Obviously, let’s look at the example now:
HTML Learning Manual column. If you have any questions, you can leave a message below.
【Editor's Recommendation】How to set spaces in HTML paragraph elements? Summary of HTML space settings
#How to use the big tag in html? Usage examples of html big tag
The above is the detailed content of How to set background color in html? Detailed analysis of HTML background color code. For more information, please follow other related articles on the PHP Chinese website!

如何在Eclipse中设置背景颜色?Eclipse是广受开发人员欢迎的集成开发环境(IDE),可用于各种编程语言的开发。它非常强大且灵活,可以通过设置来自定义界面及编辑器的外观。本文将介绍如何在Eclipse中设置背景颜色,并提供具体的代码示例。一、更改编辑器背景颜色打开Eclipse,并进入“Windows”菜单。选择“Preferences”。在左侧导航

本篇文章带大家了解一下HTML(超文本标记语言),介绍一下HTML的本质,HTML文档的结构、HTML文档的基本标签和图像标签、列表、表格标签、媒体元素、表单,希望对大家有所帮助!

小伙伴们知道editplus如何设置背景颜色吗?今天小编就来讲解editplus设置背景颜色的方法,感兴趣的快跟小编一起来看看吧,希望能够帮助到大家。第一步:首先打开editplus,点击上方的Tools,如图:第二步:在工具菜单中,点击preferences,如图:第三步:在首选项页面,点击左侧的colors,如图:第四步:在background位置,根据需要选择颜色即可,如图:

一步步教你在Eclipse中更改背景颜色,需要具体代码示例Eclipse是一款非常流行的集成开发环境(IDE),经常被用来编写和调试Java项目。在默认情况下,Eclipse的背景颜色是白色,但是有些用户可能希望更改背景颜色以适应自己的喜好或减轻眼部疲劳。本文将一步步教你如何在Eclipse中更改背景颜色,并提供具体的代码示例。步骤1:打开Eclipse首先

PyCharm是一款功能强大的Python集成开发环境(IDE),它为开发者提供了许多方便的功能和工具。其中一个常用的功能是修改PyCharm的背景颜色。在这篇文章中,我将详细介绍PyCharm背景颜色修改的方法,并提供具体的代码示例。要修改PyCharm的背景颜色,我们需要进行以下几个步骤:第一步:打开PyCharm并点击"File"菜单下的"Settin

Eclipse背景颜色设置教程Eclipse是一款非常受欢迎的集成开发环境(IDE),用于开发各种编程语言的应用程序。它具有丰富的功能和灵活的配置选项,可以根据个人需求进行自定义设置。其中一个常见的个性化需求就是更改Eclipse的背景颜色。这篇文章将向你详细介绍如何设置Eclipse的背景颜色。我们将提供具体的代码示例来帮助你快速实现这一目标。步骤1:打

总结了一些web前端面试(笔试)题分享给大家,本篇文章就先给大家分享HTML部分的笔试题(附答案),大家可以自己做做,看看能答对几个!

Word是一款由微软公司开发的文字文档处理工具。它提供了丰富的文档编辑功能,包括文本输入、表格制作、格式调整等,可以轻松地创建和编辑各种类型的文档,如报告、简历并且提供更丰富的模板和图形功能。正因为我们长时间使用word办公,背景颜色不合适可能会让我们视觉疲劳,甚至影响办公速度,那么就很有学习去掉word背景颜色的方法了。word背景颜色怎么去掉?去掉word背景颜色的方法1、打开需内要操作的WORD文档容,在工具栏中点击“页面布局”标签页。2、找到并点击“页面颜色”,并选择“无颜色”即可。3、


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
