- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我不知道为什么,但我似乎无法让这个页脚正确地到底部,我的 body 似乎只在页面的一半处?我将整个东西包裹在 main 中,看看如果我在上面设置一个高度是否可以解决它,它似乎每次都只有相同的高度。就像它没有捕捉到视口(viewport)或其他东西并导致它只上升了一半。另外,请让我成为一个新的编码员,所以如果你的 awnser 只是一般性的建议来改进我的一切。提前谢谢!
h1 {
font-family: 'Dancing Script', cursive;
text-align: center;
font-size: 4vmin;
}
p {
text-align: center;
font-size: 3vmin;
}
li {
font-size: 3vmin;
}
header {
text-align: center;
height: auto;
width: auto;
background-color: white;
box-shadow: 2px 2px 2px 1px gray;
margin-bottom: 2%;
margin-right: 1%;
}
#main {
position: relative;
min-height: 100vh;
}
#img-div {
display: flex;
margin: auto;
justify-content: center;
flex-direction: column;
background-color: white;
box-shadow: 0px 1px 2px 5px gray;
max-width: 100vw;
max-height: 100vh;
}
#image {
box-shadow: 0px 1px 3px 5px gray;
max-width: 70%;
margin-left: 15%;
margin-top: 1%;
}
#tribute-info {
max-width: 100vw;
max-height: 100vh;
}
#young {
background-color: white;
box-shadow: 0px 1px 3px 5px gray;
}
#youngteddy {
width: 85%;
margin-left: 7%;
box-shadow: 0px 1px 3px 5px gray;
}
#prior {
max-width: 100vw;
max-height: 100vh;
box-shadow: 0px 1px 3px 5px gray;
background-color: white;
}
#priorimg {
max-width: 70%;
margin-left: 15%;
box-shadow: 0px 1px 3px 5px gray;
}
#pres {
max-width: 100vw;
max-height: 100vh;
background-color: white;
box-shadow: 0px 1px 3px 5px gray;
}
#president {
max-width: 40%;
margin-left: 30%;
box-shadow: 0px 1px 3px 5px gray;
}
#end {
max-width: 100vw;
max-height: 100vh;
margin-top: 10%;
box-shadow: 0px 1px 3px 5px gray;
background-color: white;
}
#endimg {
max-width: 100%;
margin-left: 20%;
box-shadow: 0px 1px 3px 5px gray;
}
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600&display=swap" rel="stylesheet">
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<!-- Link to FCC Tester In top Left -->
<header>
<h1 id='title'>President Theodore "Teddy" Roosevelt </h1>
<p>"Walk softly, and carry a big stick"</p>
</header>
<body>
<div id='main'>
<div id='img-div'>
<img id='image' src='https://www.buddenbrooks.com/pictures/70094_1.jpg?v=1593026042' alt='Theodore after hunting a cheetah'>
<p id='img-caption'>Theodore Roosevelt kneeling in front of a cheetah</p>
</div>
<div id='tribute-info'>
<div id='young'>
<h1>
<B>Teddy's Youth</B>
</h1>
<img id='youngteddy' src='https://image.pbs.org/video-assets/pbs/roosevelts/142017/images/mezzanine_487.jpg.crop.1920x1080.jpg' alt='Theodore Roosevelt as a young child'>
<ul id=y list>
<li><b>1858</b>: Theodore was Born to Martha and Bulloch Roosevelt</li>
<li><b>1870</b>: Begins a physical regime that he continues throuout his life.
<li><b>1876</b>: Begins study at Harvard University</li>
<li><b>1878</b>: Meets his first wife, Alice Hathaway Lee
<li><b>1880</b>: Graduates Harvard Magna Cum Laude, and joins the Republican Party</li>
</div>
<div id='prior'>
<h1>Prior to his Presidency</h1>
<img id='priorimg' src='https://publicradio1-wpengine.netdna-ssl.com/newscut/files/2015/07/roosevelt.jpg' alt='President Theodore Roosevelt during his time as a RuffRider standing beside his horse'>
<ul>
<li><b>1882</b>: Publishes first major literary work, 'The Naval War of 1812'</li>
<li><b>1884</b>: Mother and Wife die of illness</li>
<li><b>1888</b>: Publishes several books, including Life of Gouverneur Morris, Ranch Life and the Hunting Trail, and Essays in Practical Politics</li>
<li><b>1889</b>: Starts as U.S. Civil Service Commissioner in Washington, DC</li>
<li><b> 1895</b> Reigns from Civil Service to become Police Commisioner of New York.</li>
<li><b>1897</b>: Appointed Assistant Seceratary of the Navy by William Mckinley</li>
<li><b>1898</b>: Forms the 'Rough-Riders' and serves as a Colonel in Cuba during the Spanish-American War</li>
</ul>
</div>
<div id='pres'>
<h1>Becoming President Theodore Roosevelt</h1>
<img id='president' src='https://upload.wikimedia.org/wikipedia/commons/d/df/Theodore_Roosevelt_circa_1902.jpg' alt='President Theodore Roosevelt'>
<ul>
<li><b>1901</b>: Serves as Vice President from March to September</li>
<li><b>1901</b>: Becomes President in September, the youngest president ever.</li>
<li><b>1902</b>: Begins anti-trust lawsuits to dissolve 42 monopolies</li>
<li><b>1903</b>: Establishes Pelican Island, FL as first federal bird reserve and Begins building Panama Canal</li>
<li><b>1904</b>:Re-elected president, established United States Forest Service</li>
<li><b>1905</b>:Establishes Wichita Forest, OK as first federal game preserve. Establishes Russo-Japaneese Peace Treaty</li>
<li><b>1906</b>: Established many national parks. Visited Panama Canal, becoming the first president to do so. Won the Nobel Peace Prize.</li>
</ul>
</div>
<div id='end'>
<h1>End of an era</h1>
<img id='endimg' src='https://allthatsinteresting.com/wordpress/wp-content/uploads/2016/10/pointing.jpg' alt='Theodore Roosevelt giving a speech after just being shot'>
<ul>
<li><b>1909</b>: End of his Presidency. Departs for year-long African safari with son Kermit</li>
<li><b>1910</b>: Accepts Peace Prize in Norway. Publlishes "African Game Trails", and returns to New York from travels around the globe.</li>
<li><b>1912</b>:Pressured to accept Presidental nomination. Becomes presidential cantidate of the "Bull Moose" or Progressive party. Deliveres famous speech despite being shot in the chest before it.</li>
<li><b>1913</b>: Publishes "Theodore Roosevelt - An Autobiography and History as Literature and Other Essays"</li>
<li><b>1914</b>:Embarks on an expedition to explore an uncharted tributary of Amazon River, which he nearly dies during. Publishes two books named "Through the Brazilian Wilderness" and "Life Histories of African Game Animals"</li>
<li><b>1918</b>: Publishes "The Great Adventure".</li>
<li><b>1919</b>: Dies in sleep at Sagamore Hill of a coronary embolism (arterial blood clot), age 60</li>
</ul>
</div>
</div>
<footer>
<div id='tlink-container'>
<p>Intrested in learning more about the Bull-Moose?
<a id='tribute-link' target="_blank" href='https://www.britannica.com/biography/Theodore-Roosevelt'>Click here</a>
</div>
</footer>
</div>
最佳答案
行max-height: 100vh
在#tribute-info 中是造成这种情况的原因。如果删除它,页脚将正确显示在底部。
此外,<header>
标签是 <body>
的一部分, 不在 <head>
之间和 <body>
.
关于html - 正文只在页面的一半左右,导致我的页脚显示在页面的中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67665368/
我在休息服务中有以下方法: @POST @Path("/create") @ResponseStatus(HttpStatus.CREATED) @Consumes(M
这个问题不太可能对 future 的访客有帮助;它只与一个小的地理区域、一个特定的时刻或一个非常狭窄的情况相关,通常不适用于互联网的全局受众。如需帮助使这个问题更广泛地适用,visit the hel
我有这样的弹出框: Speelland And here's some amazing content. It's very engaging. Right? Meer
我正在开发一个 firefox 插件,我正在收听这样的 http 响应: var observerService = Components.classes["@mozilla.org/observer
我正在使用 jqtouch 制作一个移动网站。我还在网站中实现了图库图像 slider ,但是当图库放在我需要的位置时(在 之间,图像不会显示。 修补了几个小时后,删除了 display: none
为了在 iPad 上的 Safari 上显示视差效果,我采用了以下 CSS 规则: body:after { content: ""; position: fixed; top
我想在通过 excel VBA 创建的电子邮件正文中插入一个链接。链接每天都在变化,所以我把它的值放在单元格 B4 中。但是,我找不到正确的方法来发送带有该链接的电子邮件。 这是我正在使用的代码: P
我正在尝试使用具有非常大主体的 Postman 执行 POST 请求。只有一个 JSON 字段非常大,我想知道是否可以从 Postman 的文件中加载该字段? { "field1": {
这个问题是针对 SoapUI 5.2.1 社区版的: 我有一个包含变量的 JSON 主体的 POST 请求。 我总是能够通过单击“原始”选项卡以查看请求进行或将发送到服务器来验证这些参数是否采用正确的
我有这个按钮,单击该按钮会打开 Outlook,其中包含我提供的详细信息。我还有一个 TEXTAREA,其中包含某些文本。我正在寻找一种方法让此文本出现在我的 Outlook 正文中。这可以做到吗?请
我知道错误消息是不言自明的,我们无法多次读取消息正文。这里我使用AOP(面向方面编程)来进行审计日志。 [AuditServiceMethod(AttributePriority = 0)] [F
我在 grails 3.3.3 中编写自定义验证器(命令)时遇到了一些问题。具体来说,我正在尝试验证其正文由项目列表组成的 POST 请求。这就是我所拥有的... 命令: class VoteComm
这个问题在这里已经有了答案: json.Marshal(struct) returns "{}" (3 个回答) JSON and dealing with unexported fields (3
我想清理很多邮件的 HTML 正文,它们有点脏(取自 Gmail 发送的电子邮件):有很多嵌套 ,不需要的字体更改等我想清理它并只保留 , , , , , 仅此而已(可能还有 或一些 ,
我正在使用 Accordion 功能在我的模块中添加端口详细信息。我只想在水平方向上显示正文内容。请看下面的 fiddle 。 html, body { background-color:#e
我的 HTML 正文中有这个: loaded y&EACUTE;t. 使用 JavaScript 我有这个: $( document ).ready(function() { document.bod
我对图表有很大的疑问。我试图在谷歌图表中显示一些 json 值,但我总是会出错。从 JSON 正文中,我只需要图表上个月的“全部购买”和“日期”。我见过的所有例子,他们已经有了一个静态的自定义 Jso
我的应用程序的功能之一涉及用户填写三个单独的文本字段(预订名称、客人和日期),然后使用文本编辑器通过短信发送这些字段中的文本。我无法将这些 View 中的文本放入正文中。这是我的代码: - (IBAc
我正在开发一个 HTA,它应该对 onunload 事件进行一些最终修改。该事件似乎没有被触发。 该事件是否仍受支持?是否有 IE 事件可以知道页面何时关闭? 我检查了一下(JavaScript bo
我正在尝试将以下图像添加为网站内容的背景: http://webbos.co/vibration/wp-content/themes/vibration-child-theme/images/back
我是一名优秀的程序员,十分优秀!