主頁
CSS
CSS 顏色關鍵字
試一試:使用 currentcolor 關鍵字
執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> body { color: purple; } div { background-color: currentcolor; padding: 15px; } div p { color: white; } </style> </head> <body> <h2>The currentcolor Keyword</h2> <p>This is some text in the body part...</p> <div> <p>This div's background color is set to the current color value of the body element.</p> </div> </body> </html>