gpt4 book ai didi

css - 两个 Div - 第二个的居中和背景未显示

转载 作者:行者123 更新时间:2023-11-28 13:42:34 25 4
gpt4 key购买 nike

我正在尝试制作一个包含三个具有相同背景的 div 的网页,一个在左上角(就像您在屏幕上看到的那样),一个在右中,一个在左下角。我得到了左上角的工作并复制了相同的代码只是改变了对齐方式。第二个只是将文本放在顶部,没有格式。这让我抓狂。

谢谢

  body {
font-family: Copperplate / Copperplate Gothic Light, sans-serif;
background-image: url(AAHbackground.jpg);
background-size: cover;
}


#welcome {
padding: 5px; 5px;5px; 5px;
padding-left: 10px;
margin: 10x 10x 10x 10x;
text-align: left;
color: #191919;
background-image: url(Divbackgrounds.jpg);
background-repeat: no-repeat;
float: left;
width: 350px;
p style = "float: left;"
color : #731D1D;
h1, h2 {
color: #FF0066;
}

#leed {
padding: 5px; 5px;5px; 5px;
padding-right: 30px;
margin: 10x 10x 10x 10x;
text-align: center;
color: #191919;
background-image: url(Divbackgrounds1.jpg);
background-repeat: no-repeat
position: absolute; left: 100px; top: 100px;
width: 350px;
color : #731D1D;
h1, h2 {
color: #FF0066;
}

问题来了。它似乎在移动文本等但没有将背景图像附加到它。这是 HTML 代码。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="AAHStylesheet.css"/>
<title>Appalachian </title>

</head>

<body>

<div id ="welcome">
<h1> Title </h1>

<p>text text text</p>


</div>

<div id ="leed">
<h1>Header/h1>

<p>text .</p>

</div>

</body>
</html>

请帮忙:)

最佳答案

关于css - 两个 Div - 第二个的居中和背景未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12233521/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com