用Javascript制作一个背景为红色内容为hello的页面 给出代码
以下是用JavaScript制作一个背景为红色,内容为"hello"的页面的代码:
<!DOCTYPE html>
<html>
<head>
<title>Red Background</title>
<style>
body {
background-color: red;
text-align: center;
font-size: 36px;
color: white;
padding: 100px;
}
</style>
</head>
<body>
<script>
document.body.innerHTML = "hello";
</script>
</body>
</html>
这个代码将设置页面的背景颜色为红色,并在页面中显示"hello"。
原文地址: https://www.cveoy.top/t/topic/hLqF 著作权归作者所有。请勿转载和采集!