- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为一个学校元素制作一个网站,但遇到了一个问题。每当我调整屏幕大小时,所有内容都会移动并扭曲大小,尤其是列表。有没有一种方法可以让我包装所有元素,以便在调整屏幕大小时(当我水平/垂直拖动它以使其变小时)所有内容都保持原位,我只看到屏幕上的内容更少,需要滚动到看到剩下的了吗?我尝试将所有内容设置为 em/px,但仍然留下空白和困惑的列表栏。
这是 CSS
#title{
font-family:basic title font;
color:#ffffff;
position: absolute;
left:33%;
top:-2.3%;
font-size:1.6em;
z-index:1;}
#intro{
font-family:basic title font;
color:#636363;
position: absolute;
left:62%;
top:32%;
font-size:2.5em;
z-index:1;
font-weight:900;}
#schedule{
font-family:basic title font;
color:#636363;
position: absolute;
left:35%;
top:28%;
font-size:3em;
z-index:1;
font-weight:900;
}
#skl {
z-index:100;
position:absolute;
width:34%;
left:7%;
top:37%;
z-index:1;}
#box {
width:28%;
height:60%;
background-color: #D6D6D6;
position:absolute;
top:48%;
left:54%;
}
#box2 {
width:28%;
height:60%;
background-color: #D6D6D6;
position:absolute;
top:48%;
left:19%;
}
#wordbox1 {
width:28%;
height:30%;
background-color: #D6D6D6;
position:absolute;
top:111%;
left:19%;
}
#wordbox2 {
width:28%;
height:30%;
background-color: #D6D6D6;
position:absolute;
top:111%;
left:54%;
}
#box3 {
width:26%;
height:6%;
background-color: white;
position:absolute;
top:100%;
left:20%;
}
#box4 {
width:26%;
height:6%;
background-color: white;
position:absolute;
top:100%;
left:55%;
}
#q1{
width:28%;
height:14%;
background-color: #D6D6D6;
position:absolute;
top:144%;
left:19%;
}
#q2{
width:28%;
height:14%;
background-color: #D6D6D6;
position:absolute;
top:144%;
left:54%;
}
#text
{font-family:basic title font;
color:#636363;
position: absolute;
left:38.5%;
top:1.2%;
font-size:4em;
z-index:1;}
#text2
{font-family:basic title font;
color:#636363;
position: absolute;
left:55%;
top:1.2%;
font-size:4em;
z-index:1;}
#logo {
position:absolute;
top:5%;
left:43%;
z-index:1;
width:12%;
}
#midbar {
width:100%;
height:6%;
background-color: #636363;
position:absolute;
top:22%;
}
#bar {
width:100%;
height:160%;
background-color: #F0F0F0;
position:absolute;
top:28%;
}
#midbar2 {
width:100%;
height:17%;
background-color: #D6D6D6;
position:absolute;
top:5%;
}
#midbar3 {
width:100%;
height:5%;
background-color: #636363;
position:absolute;
top:0%;
}
#divider {
width:100%;
height:1%;
background-color: #636363;
position:absolute;
top:88%;
}
body {
color: #fff;
font-family: 'open sans';
font-size: 1.1em;
text-align: center;
text-decoration:none;
font-weight:100;
display:inline;
}
#primary_nav_wrap
{
margin-top:15px
}
#primary_nav_wrap ul
{
list-style:none;
position:absolute;
float:left;
margin:0;
top:22%;
left:9%;
padding:0;
max-width:100%;
min-width:50%;
max-height:500px;
min-height:21%;
text-align:center;
}
#primary_nav_wrap ul a
{
display:block;
text-decoration:none;
font-weight:700;
font-size:12px;
line-height:32px;
padding:0 15px;
font-family: 'open sans';
font-weight:100;
font-size: 0.9em;
color: #ffffff;
text-align:center;
padding-top:0.5em;
padding-bottom:0.5em;
padding-right:4em;
padding-left:4em;
}
#primary_nav_wrap ul li
{
position:relative;
float:left;
margin:0;
padding:0
}
#primary_nav_wrap ul ul
{
display:none;
position:absolute;
top:100%;
left:0%;
text-align:left;
background-color:#636363;
z-index:100;
}
#primary_nav_wrap ul ul li
{
float:none;
width:187px;
padding-left:1em;
padding-right:1em;
}
#primary_nav_wrap ul ul a
{
line-height:120%;
padding:10px 15px;
}
#primary_nav_wrap ul ul ul
{
top:0;
left:100%
}
#primary_nav_wrap ul li:hover > ul
{
display:block
}
.hvr-fade {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-property: color, background-color;
transition-property: color, background-color;
}
.hvr-fade:hover, .hvr-fade:focus, .hvr-fade:active {
box-shadow: inset 0 2px 10px -5px #000000;
background-color: #2098d1;
color: white;
z-index:1
}
#bottomtext {
position:absolute;
bottom:-83%;
left:43%;
font-family:"myriad pro";
font-weight:300;
color:black;
font-size:0.8em;
z-index:10000;}
#bottomtext2 {
position:absolute;
bottom:-89%;
left:44%;
font-family:"myriad pro";
font-weight:200;
color:black;
font-size:0.6em;
z-index:1000000}
#bottom {
width:100%;
height:15%;
background-color: white;
position:absolute;
bottom:-88%;
z-index:1000;
}
a { text-decoration: none; }
p { text-align: center; }
sup { font-size: 36px; font-weight: 100; line-height: 55px; }
.button
{
text-transform: uppercase;
letter-spacing: 2px;
text-align: center;
color: #0C5;
font-size: 1em;
font-weight: 300;
margin: 4em auto;
position: absolute;
top:150%; right:0; bottom:0; left:-34%;
padding: 10px 0;
padding-bottom:20px;
width: 28%;
height:2%;
background: #2098d1;
border: 1px solid #2098d1;
color: #FFF;
overflow: hidden;
transition: all 0.5s;
}
.button:hover, .button:active
{
text-decoration: none;
color: #2098d1;
border-color: #2098d1;
background: #FFF;
}
.button span
{
display: inline-block;
position: relative;
padding-right: 0;
transition: padding-right 0.5s;
}
.button span:after
{
content: ' ';
position: absolute;
top: 0;
right: -18px;
opacity: 0;
width: 10px;
height: 10px;
margin-top: -10px;
background: rgba(0, 0, 0, 0);
border: 3px solid #2098d1;
border-top: none;
border-right: none;
transition: opacity 0.5s, top 0.5s, right 0.5s;
transform: rotate(-45deg);
}
.button:hover span, .button:active span
{
padding-right: 30px;
}
.button:hover span:after, .button:active span:after
{
transition: opacity 0.5s, top 0.5s, right 0.5s;
opacity: 1;
border-color: #2098d1;
right: 0;
top: 50%;
}
a { text-decoration: none; }
p { text-align: center; }
sup { font-size: 36px; font-weight: 100; line-height: 55px; }
.move
{
text-transform: uppercase;
letter-spacing: 2px;
text-align: center;
color: #0C5;
font-size: 1em;
font-weight: 300;
margin: 4em auto;
position: absolute;
top:150%; right:0; bottom:0; left:36%;
padding: 10px 0;
padding-bottom:20px;
width: 28%;
height:2%;
background: #2098d1;
border: 1px solid #2098d1;
color: #FFF;
overflow: hidden;
transition: all 0.5s;
}
.move:hover, .move:active
{
text-decoration: none;
color: #2098d1;
border-color: #2098d1;
background: #FFF;
}
.move span
{
display: inline-block;
position: relative;
padding-right: 0;
transition: padding-right 0.5s;
}
.move span:after
{
content: ' ';
position: absolute;
top: 0;
right: -18px;
opacity: 0;
width: 10px;
height: 10px;
margin-top: -10px;
background: rgba(0, 0, 0, 0);
border: 3px solid #2098d1;
border-top: none;
border-right: none;
transition: opacity 0.5s, top 0.5s, right 0.5s;
transform: rotate(-45deg);
}
.move:hover span, .move:active span
{
padding-right: 30px;
}
.move:hover span:after, .move:active span:after
{
transition: opacity 0.5s, top 0.5s, right 0.5s;
opacity: 1;
border-color: #2098d1;
right: 0;
top: 50%;
}
这是 HTML!
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<link rel="stylesheet" type="text/css" href="sc.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="robots" content="all,index,follow" />
<title>KAS</title>
<meta name="description" content="Create a sticky navigation bar that remains fixed to the top after scroll" />
</head>
<div id="wrapper">
<body>
<p id="title">SOUTHERN TAIWAN MODEL UNITED NATIONS</p>
<p id="intro"></p>
<p id="schedule">SECURITY COUNCIL</p>
<p id="text">20 </p>
<p id="text2">15 </p>
<p id="bottomtext">Kfiller Afiller Sfiller <br>
www.filler.com </p>
<p id="bottomtext2">(c) 2015 by FIller Filler Filler</p>
<div id="bottom"></div>
<img id="logo" src="images/logo2.png">
<div id="topbar"></div>
<div id="midbar"></div>
<div id="midbar2"></div>
<div id="midbar3"></div>
<div id="bar"></div>
<div id="bar2"></div>
<div id="box"></div>
<div id="box2"></div>
<div id="box3"></div>
<div id="box4"></div>
<div id="q1"></div>
<div id="q2"></div>
<div id="wordbox1"></div>
<div id="wordbox2"></div>
</div>
<a href="#" class="button">
<span>Download Chair Report</span>
</a>
<a href="#" class="move">
<span>Download Chair Report</span>
</a>
<div id="whitebox"></div>
<!--<div id="divider"></div>--!>
<img id="skl" src="">
<nav id="primary_nav_wrap">
<ul>
<li class="hvr-fade" class="current-menu-item"><a href="#">HOME</a></li>
<li class="hvr-fade" ><a href="#">INTRODUCTION</a></li>
<li class="hvr-fade"><a href="#">COMMITTEES</a>
<ul >
<li class="hvr-fade"><a href="#">Security Council</a></li>
<li class="hvr-fade"><a href="#">CDIS</a></li>
<li class="hvr-fade"><a href="#">ECOSOC</a></li>
<li class="hvr-fade"><a href="#">HRC</a></li>
<li class="hvr-fade"><a href="#">General Assembly 1</a></li>
<li class="hvr-fade"><a href="#">General Assembly 2</a></li>
<li class="hvr-fade"><a href="#">General Assembly 3</a></li>
</ul>
<li class="hvr-fade"><a href="#">CONTACT</a></li>
<li class="hvr-fade"><a href="#">NEWS</a></li>
<li class="hvr-fade"><a href="#">MORE</a></li>
</ul>
</nav>
这是我的第一个网站。感谢您的任何和所有输入! :D
最佳答案
首先是 <div id="wrapper">
应该在 body 标签里面
要解决您的问题,请尝试在 CSS 中将 min-width 设置为 body。
例如。
body{
min-width:720px;//or whatever value
}
如果屏幕宽度小于 720px 会出现水平滚动条
关于html - 调整大小时修复页面布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31626605/
我有 0 小时、3 小时、12 小时、24 小时、48 小时的数据组……我想绘制这些数据的图表,以便保留时间的比例。 runs <- c(1:25) hours <- as.factor(c(0, 3
例如,如果我选择了时间:下午 3 点和小时数:5 小时,则得到 (8pm) 作为答案“ 最佳答案 let calendar = Calendar.current let date = calendar
我有一个包含两个日期时间字段的表单。用户输入日期 (yyyy-mm-dd) 和时间(3 个框;小时、分钟、上午/下午)。 出于某种原因,第一个没有保存为 24 小时制。 以下数据为输入结果: 2011
我一直在尝试使用导出单位进行计算,但到目前为止我还没有取得任何成果。 我已经尝试过mathjs ,但如果我输入 1 小时 * 1 英里/小时,我会得到 UnsupportedTypeError: Fu
我有两组要运行的 cronjob。第一个应该每 3 小时运行一次,第二个也应该每 3 小时运行一次,但比第一组晚一个小时。什么是正确的语法? // every 3 hours 17 */3 * *
我知道 AWS 中的预留实例更多的是计费而不是实际实例——它们没有附加到实际实例——我想知道: 如果我在特定区域和可用区中购买特定时间的预留实例 - 如果我每天 24 小时使用单个实例与运行 24 个
我试过: seq( from=as.POSIXct("2012-1-1 0", tz="UTC"), to=as.POSIXct("2012-1-3 23", tz="UTC"),
我有一个带有“日期”列的表。我想按小时分组指定日期。 最佳答案 Select TO_CHAR(date,'HH24') from table where date = TO_DATE('2011022
我知道如何在 SQL (SQL Server) 中获取当前日期,但要获取当天的开始时间: select dateadd(DAY, datediff(day, 0, getdate()),0) (res
我正在尝试在游戏之间创建一个计时器,以便用户在失去生命后必须等待 5 分钟才能再次玩游戏。但是我不确定最好的方法是什么。 我还需要它来防止用户在“设置”中编辑他们的时间。 实现这一目标的最佳方法是什么
我的查询有误。该错误显示预期的已知函数,得到“HOUR”。如果我删除这部分,查询将正常工作 (AND HOUR({$nowDate}) = 11) SELECT c FROM ProConvocati
var d1 = new Date(); var d2 = new Date(); d2.setHours(d1.getHours() +01); alert(d2); 这部分没问题。现在我试图在 (
我正在构建一个用于练习的基本时钟应用程序,但出于某种原因,时间不会自动更改为最新的分钟或小时。例如,当前时间是 17:56,但它显示的是 17:54,这是我打开应用程序的最后时间。 NSDate *n
我创建了一张图片,我想将其用作页面的 hr。当它被上传时,它一直向左对齐。我希望它居中,在标题下。这是我的 CSS 代码: .section-underline { height: 35px
这个问题已经有答案了: Getting difference in seconds from two dates in JavaScript (2 个回答) 已关闭 4 年前。 我想计算两个具有不同格
我需要计算到某个日期/时间的剩余时间(天/小时)。 但是,我没有使用静态日期。 假设我在 每个星期日 的 17:00 有一个事件。我需要显示到下一个事件的剩余时间,即即将到来的星期日 17:00。 我
我正在执行这个脚本: SELECT EXTRACT(HOUR FROM TIMEDIFF('2009-12-12 13:13:13', NOW())); 我得到:-838。这是提取时 MySQL 可以
复制代码 代码如下: /** * 小时:分钟的正则表达式检查<br> * <br> * @param pInput 要检查的字符串 * @return boolean 返
连wifi5元/小时 独领风骚 朕好帅 今晚你是我的人 十里桃花 高端定制厕所VP专用 一只老母猪 在家好无聊 你爹的wifi 密码是叫爸爸全拼 关晓彤和鹿晗分手了吗 蹭了我的
我有以下数据框列: 我需要将 csv 列中的对象字符串数据转换为总秒数。 示例:10m -> 600s 我试过这段代码: df.duration = str(datetime.timedelta(df
我是一名优秀的程序员,十分优秀!