gpt4 book ai didi

html - 格式化H1/H2/H3,以及一段打开的HTML

转载 作者:行者123 更新时间:2023-11-28 03:07:04 24 4
gpt4 key购买 nike

我正在构建我的第一个网站来学习 HTML/CSS/jQuery(它托管在我的 Raspberry Pi 上)。我现在有两个问题:超大屏幕/新闻容器右侧的 HTML 条(我将所有 HTML 设置为蓝色以便可以看到)。此外,我正在尝试让“hello world”h3 紧贴在 h2 下方。我正在使用占位符文本来解决所有问题。我应该编辑哪些 CSS 属性来执行此操作?您可以在 Ericscode.com 上实时访问该网站。

HTML:

<!doctype html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Orbitron:400,700|Droid+Sans:400,700|Pacifico' rel='stylesheet' type='text/css'>
<!-- CSS from Bootstrap's website -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- End Bootstrap head -->
<!-- My personal CSS -->
<link rel="stylesheet" href="css/main.css">

</head>
<body>
<div class="nav">
<div class="container">
<div class="logo">
<div class="pull-left">
<a href="index.html">Erics Code</a>
</div>
</div>
<div class="pull-right">
<ul padding-top: 50px;>
<li><a href="#">About Me</a></li>
<li>|</li>
<li><a href="#">My Projects</a></li>
<li>|<li>
<li><a href="#">Contact Me</a> </li>
</ul>
</div>
</div>
</div>



<div class="jumbotron">
<div class="container">
<h1>My Projects and Portfolio</h1>
<p>I do internet things</p>
</div>
</div>


<div class="news">
<div class="container">
<h1>News & Updates</h1>
<h2>New Personal Website</h2>
<h3>Hello World</h3>
<p>This is the first iteration of the website. Expect constant changes and unfinished scripts.</p>


</div>
</div>


<div class="footer">

<div class="row">
<div class="col-md-12 text-center">
<div class="container">
<p>Erics Code, personal Internet workspace</p>
<p>Hosted on Raspberry Pi</p>
<p>~ <a href="contact_me.html">Contact Me</a> ~</P>
</div>



</div>

</div>
</div>

</body>

CSS:

html {
background-color: blue;

}

.nav {
background-color: #5a5a5a;
height: 70px;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;

}

.nav li{
display: inline-block;
padding: 14px 10px;
text-transform: lowercase;
font-weight: normal;
font-size: 18px;
padding-top: 40px;
padding-left: 0px;
font-family: 'Droid Sans';
color: white;
}

.nav a {
color: white;
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
/* ...and now for the proper property */
transition:.5s;
}

.nav a:hover {
color: #ed8200;
text-decoration: none;
}


.jumbotron {
background-image: url('http://ericscode.com/images/banner1.png');
height: 500px;
background-size: cover;
background-repeat: no-repeat;
padding-top: 75px;
font-family: 'Droid Sans';
text-align: center;

}
.jumbotron .container {
position: relative;
top: 100px;
}

.jumbotron h1 {
color: #ed8200;
font-weight: bold;

}

.jumbotron p {
color: white;
padding-top: 15px;
font-family: 'Droid Sans'
}

.maincontent {
background-color: purple;
font-family: 'Droid Sans';
}

.logo {
font-family: 'Pacifico', sans-serif;
font-size: 50px;
color: white;
padding-top: 0px;
}

.logo a {
color: white;

}

.news {
height: 500px;
}

.news h1{
font-family: 'Droid Sans';
color: #5a5a5a;
font-weight: bold;
font-size: 50px;
}

.news h2{
color: #5a5a5a;
}

.news h3{
font-family: 'Orbitron';
color: black;
padding-top: 0px;
color: #ed8200;
font-size: 18px;
}

.news p{
font-family: 'Droid Sans';
}

.footer {
background-color: #5a5a5a;
height: 140px;
color: white;
}

.footer a {
color: white;
}

.footer a:hover {
color: #ed8200;
text-decoration: none;
}
.footer .container {
padding-top: 40px;
}

如果您看到任何我应该更改/改进的地方,请告诉我!一旦我有一个适当的网站骨架设置,我将学习更多的 Javascript 并使用 jQuery 实现一些平滑的过渡。

最佳答案

要使 h3 舒适,给 h3 一个类:

<h3 class="h3">Hello World</h3>

并设置样式:

h3.h3{
margin-top: 0 !important;
}

要修复横向滚动,请将其添加到您的样式表中:

html, body {
max-width: 100%;
overflow-x: hidden;
}

关于html - 格式化H1/H2/H3,以及一段打开的HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32172029/

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