源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> <style> .center { text-align: center; color: red; } </style> </head> <body> <h1 class="center">红色居中的标题</h1> <p class="center">红色居中的段落.</p> </body> </html>
运行结果