gpt4 book ai didi

html - 文本 "wrapping itself"且未按行显示

转载 作者:行者123 更新时间:2023-11-28 01:42:20 27 4
gpt4 key购买 nike

文本是“ self 包装”而不是按行显示。我曾尝试使用 p { display:in-line;} 但这没有做任何事情。几乎是一个接一个地出现在之前这个词的下方。我想知道为什么?请帮忙,谢谢! (我使用的是 google 之外的字体,但我不希望这会改变这种情况)

<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="aboutme.css">
<title>It's all about me!</title>
</head>
<body>
<header>
<div class="grow">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="aboutme.html">About me</a></li>
<li><a href="like.html">What I love</a></li>
</ul>
</div>
</header>
<h1>About Me<h1>
<p>Hi, welcome to my website. I am not sure why this is not working at the moment.</p>
</body>
</html>

------------------------------------另一个文件中的CSS------ ------------------------

body {
background-image: url(magical.jpg);
}
h1 { font-family: 'Lobster', cursive;

color: white;
position: absolute;
top: 200px;
left: 630px;
text-decoration: underline;
}
p { font-family: 'Lobster', cursive;
font-size: 20px;
color: white;
position: absolute;
top: 60px;
right:350px;
display: inline;

}
.grow {
position: absolute;
left: 550px;
top: 700px;
}


a {
color: black;
text-decoration: none;
font-weight: bold;
}
ul {
padding: 10px;
background: #dcf3ff;
border-width: 6px;
border-style: solid;
border-color: white;

}

li {
display: inline;
padding: 0px 15px 0px 15px;
border-right: 2px solid black;
border-left: 2px solid black;

}

.grow {
display: inline-block;
-webkit-transition-duration: 0.7s;
transition-duration: 0.7s;
-webkit-transition-property: -webkit-transform;
transition-property: transform;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
}

.grow:hover {
-webkit-transform: scale(1.3);
-ms-transform: scale(1.3);
transform: scale(1.3);
}

最佳答案

您的 h1 标签没有正确关闭。变化:

<h1>About Me<h1> 

<h1>About Me</h1>

jsfiddle

关于html - 文本 "wrapping itself"且未按行显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25188093/

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