[英]How do i change the background color of my website with HTML
Help me,i need to change the color of the background of my website and i dont know how, I still haven't tried doing that because i dont know how.帮帮我,我需要改变我网站背景的颜色,我不知道怎么做,我还没试过,因为我不知道怎么做。 I have only coded these lines:我只编码了这些行:
<!DOCTYPE html> <html> <head> <title>My first creations with coding!</title> </head> <body> <h1>My first creations with coding!</h1> <br> <p>>like pro</p> </body> </html>
You need a Cascading Style Sheet or .css
file my dude.你需要一个级联样式表或.css
文件我的家伙。 You can read more about that here .您可以在此处阅读更多相关信息。
Without reading that doc & overloading you with an insane amount of information... how can you set it up & get going?如果不阅读该文档并用大量信息使您超载...您如何设置它并开始工作?
assets
在您的网站文件夹目录中,添加一个名为assets
的新文件夹assets
folder, create a new file named style.css
在这个新的assets
文件夹中,创建一个名为style.css
的新文件style.css
to your html
file, within your head
element.将此新style.css
附加到您的html
文件中,在您的head
元素中。 Using the following code:使用以下代码: <.DOCTYPE html> <html> <head> <title>My first creations with coding!</title> <link src="/assets/style.css" rel="stylesheet"/> </head>
style.css
开放式style.css
body { background-color: black; /* change the 'black' color here ONLY */ }
List of color keywords if you scroll down.向下滚动时的颜色关键字列表。css
file.保存css
文件。Now just repeat steps 5-8 to change the background of your site.现在只需重复步骤 5-8 即可更改站点的背景。
To change the background color, you need another coding language called CSS (cascading style sheets).要更改背景颜色,您需要另一种称为CSS (级联样式表)的编码语言。 You can implement it with a <style> </style>
tag, and add CSS there, or add a separate file and link it like this:您可以使用<style> </style>
标记来实现它,并在那里添加 CSS ,或者添加一个单独的文件并像这样链接它:
<link rel="stylesheet" href="YOUR FILE HERE">
<:DOCTYPE html> <html> <head> <title>My first creations with coding;</title> </head> <body style="background-color:powderblue;"> <h1>My first creations with coding!</h1> <br> <p>>like pro</p> </body> </html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.