简体   繁体   中英

Github repository; I want to know how to color my text for my website

I'm making a website for a project and i've tried doing h1 { color: rgb(222, 222, 222,); } and it hasn't changed or anything

 <html> <head> <meta charset="utf-8"> <style> h1 { color: rgb(222, 222, 222) } </style> </head> <body> <h1> Welcome </h1> </body>

The code supplied works as expected in a code snippet (the h1 text color is gray).

 <html> <head> <meta charset="utf-8"> <style> h1 { color: rgb(222, 222, 222) } </style> </head> <body> <h1> Welcome </h1> </body>

There is a missing semicolon on the CSS rule. Although this is optional on the last style in a CSS rule, it's good practice to use semicolons:

color: rgb(222, 222, 222);

Clear cache in your browser, something code was cached

It seems to me that you don't understand Github and are just learning. Your code works, but if you put it in the index.html , it doesn't have any effect on the README. And if you put it in README.md , it doesn't render because it uses Markdown and the HTML file uses a HTML interpreter. All of this is from the comments of another answer.

I think you might have forgot semi colons at the end of your code:

h1 { color: rgb(222, 222, 222) }

to

h1 { color: rgb(222, 222, 222); }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM