- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建我的第一个网站来学习 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/
我尝试在安装了多类型 MFC 库的 visual studio 2015 MFC 上运行以前编写的 MFC c++ 代码。 但是,我这里仍然有 12 个关于缺少函数的错误: IntelliSense:
我正在学习 OOP 并且有疑问。假设我有一个包含 ClassB.h 的文件 ClassA.h,并且在某些时候我的 ClassB.h 需要包含 ClassA .h。 这会产生一个错误,我想我明白为什么会
我开始使用 CUDA 进行编程,在一些示例中我找到了包含文件 cuda.h、cuda_runtime.h 和 cuda_runtime_api.h 包含在代码中。有人可以向我解释一下这些文件之间的区别
我有一些生成正则表达式的代码。那么下面的表达式实际上是: ^(?:\s*((exclude|include|hide|show|protect|risk|dir-merge|merge)),\s*((
我一直在查看一些源代码,以更好地了解我们使用的这款游戏的核心,并编写更可靠、更快速的插件。然后我发现了这段奇怪的代码...... public void setMaxH(double amount)
通常我们会使用标准类型作为 std::unordered_map 的键和值.但现在我需要自定义我自己的键和值类。 键类在block_cache_key.h 中定义如下: #ifndef BLOCK_C
例如,我想要两个头文件,它们可以依赖于另一个头文件中的函数。 //Header1.h file #include Header2.h void h1(){ //... func1(); } v
我正在研究来自 Sedgewick 的 Shell 排序 Algorithms in C part 1-4在第 172 页。 我使用 size (数组的长度),而不是 l和 r (开始和结束);所以我
我在 macOS BigSur 上通过 VMWare 使用 Ubuntu 20.04.2 LTS。我安装了最新版本的 tcl、tcl-dev、tk 和 tk-dev - 版本 8.6。我想编译 Arc
我用我的 glu 和 gl 头文件构建了一个 OpenGL 程序,默认包含在 windows 7 专业版中。现在,我买了一本描述 OpenGL 游戏开发的书。这本书的作者说,我必须在我的项目中包含 g
我想在 token 中保留特殊字符,同时仍对特殊字符进行 token 化。说我有话 "H&R Blocks" 我想将其标记为 "H", "R", "H&R", "Blocks" 我读了http://w
关于 hash 作为 trans 参数的另一个问题。在下面的代码中,简单地使用 hash 会给出不正确的结果,但是将其替换为 keys 和 values 会使其正确。怎么了? my @alph1 =
我已经编写了一个 C 程序,它获取屏幕像素的 RGB 值 (0-255),并知道其位置 (x,y)。它可以在 Linux 中运行,但是当我尝试在 Visual Studio (Windows) 中编译
我已经使用 Windows 7 专业版中默认包含的 glu 和 gl 头文件构建了一个 OpenGL 程序。现在,我买了一本描述 OpenGL 游戏开发的书。这本书的作者说,我必须将glew head
#include using namespace std; #include //#include int main() { initscr();
h:messages h:form 内的组件还显示与外部组件相关的消息。 如何限制它只显示与包含 h:form 内的组件相关的消息? 我不喜欢用单独的h:message来使我的代码膨胀。每个输入组件的
我下载了示例代码和 cpp 文件,其中包含 list.h、queue.h 和 vector.h 等头文件,如果我尝试构建,我会收到“ fatal error :没有这样的文件或目录编译终止”我想我应该
我有一个编译成功的桌面项目,但是在我向项目添加新配置以支持 Windows Mobile 平台后,我收到以下错误: error C2146: syntax error : missing ';' be
有很多关于这个错误的帖子,但我无法解决它,我希望你能拿出解决方案。我在 Ubuntu 机器上。 ~/graphmap2$ 在这个文件夹中,我下载了 zlib。可以看图 经过一番谷歌搜索后,我还注意到没
是否可以在 Visual C++ 中使用以下 header : 图.h dos.h bios.h 最佳答案 据我所知,无法在 Visual C++ 中使用它, 与此同时,我希望您关注 Open Wat
我是一名优秀的程序员,十分优秀!