- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在这里设置了一个 jsfiddle 来显示正在发生的事情:
https://jsfiddle.net/ok87vwnw/
我使用了传统的 clear:both;
方法,添加了冗余命令和 div,还使用了建议的 overflow:hidden
技巧。我想要的是让 sivContent 拉伸(stretch)到其中内容的大小(主要是文本)。然后我还希望 sivHold 拉伸(stretch)以覆盖所有这些。
我希望任何修复都不需要在其 css 中设置任何元素的高度 - 这是其他人将要使用的东西,他们无法访问我的保管箱,因此他们将无法每次都编辑 css他们添加更多内容的时间。这个容器需要是灵活的。
我在下面包含了我的代码。
HTML:
<link href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,700italic,400italic" rel="stylesheet" type="text/css">
<div id="sivHold">
<div id="sivGIFHold">
<div id="sivName">TESTING TITLE</div>
</div>
<div id="sivTabs"><div class="sivTab"><input type="radio" id="tab-1" name="tab-group-1" checked><label for="tab-1" id="titleTab1">Threads</label>
<div class="sivContent">
ACTIVE
[??] Thread Name located in Location
10 Reason
10 Reason
20 Total - Claimed/Unclaimed
INACTIVE
[??] Thread Name located in Location
10 Reason
10 Reason
20 Total - Claimed/Unclaimed
COMPLETED
[??] Thread Name located in Location
10 Reason
10 Reason
20 Total - Claimed/Unclaimed
<div style="clear:both;"></div>
</div>
<div style="clear:both;"></div>
</div>
<div class="sivTab">
<input type="radio" id="tab-2" name="tab-group-1"><label for="tab-2" id="titleTab2">Orders</label>
<div class="sivContent">
ORDER FIVE
[X] Current Order!
ORDER FOUR
[o] [o] [o] [o] [o] Use magic in 5 threads
ORDER THREE
[o] Use magic during a hunt
[o] Train/Be-trained-by another character
[o] Purchase an additional spell
ORDER TWO
[o] Use magic against the Creature Account
[o] Use magic on a character not in your pack
[o] Use magic to help another character
[o] Use magic in 2 additional threads (not included in the above)
ORDER ONE
[o] Demonstrate one Customized Spell
[o] Use magic on 2 characters (not during training)
[o] Help train 2 wolves of a equal/lower order
[o] Use magic in 3 additional threads (not included in the above)
<div style="clear:both;"></div>
</div>
<div style="clear:both;"></div>
</div>
<div class="sivTab">
<input type="radio" id="tab-3" name="tab-group-1"><label for="tab-3" id="titleTab3">Upgrades</label>
<div class="sivContent">
Total Biscuits Needed: XXXXB
MAGIC
Spell - XXXB
MUTATIONS
Mutation - XXXB
SKILL-TRAITS
Skill-Trait - XXXB
ITEMS
Item - XXXB
ARTIFACTS
Artifact - XXXB
ARMOR
Armor - XXXB
POTIONS
Potion - XXXB
TOKENS
Token - XXXB
<div style="clear:both;"></div>
</div>
<div style="clear:both;"></div>
</div>
</div>
</div>
</div>
</center>
CSS:
#sivHold {
background: #272733 url('http://s2.postimg.org/m59xr8lg9/Sivaas_BG.png');
padding:20px;
width:550px;
border:10px solid #1e1e29;
}
#sivGIFHold {
background:url('http://s11.postimg.org/sq8bkw28x/Sivaas_Gif.gif');
height:550px;
width:550px;
text-align:center;
}
#sivPack {
background: rgba(30,30,41, 0.3);
padding:10px;
border-radius:37px;
height:54px;
width:54px;
margin-top:50px;
display:inline-block;
}
#sivName {
font-family:Ubuntu;
font-size:35px;
color:#dac4b3;
margin-top:20px;
letter-spacing:5px;
background: rgba(30,30,41, 0.8);
padding:10px;
border-radius:5px;
display:inline-block;
}
#sivTabs {
position: relative;
clear: both;
margin-top: -300px;
padding:5px;
}
.sivTab {
float: left;
overflow:hidden;
}
.sivTab label {
background: rgba(59,59,73,0.5);
padding: 10px;
border:;
margin-left: -1px;
position: relative;
left: 1px;
font-family:Ubuntu;
font-size: 25px;
letter-spacing: 2px;
transition: 0.5s;
border-radius: 5px;
}
.sivTab label:hover {
background: rgba(59,59,73,0.8);
transition: 0.5s;
}
#titleTab1 {
color: #d1d97e;
margin-left:80px;
}
#titleTab2 {
color: #c8ae9a;
}
#titleTab3 {
color: #272733;
}
.sivTab [type=radio] {
display: none;
}
.sivContent {
position: absolute;
left: 0px;
top: 150px;
background: #000;
right: 0;
bottom: 0;
padding: 20px;
border: 1px solid #272733;
color: #fff;
overflow:hidden;
height:100%;
clear: both;
}
[type=radio]:checked ~ label {
background: #3b3b49;
border-bottom:#;
z-index: 2;
}
[type=radio]:checked ~ label ~ .sivContent {
z-index: 1;
}
最佳答案
为了让它按照你想要的方式工作,我不得不重写整个东西,HTML 和 CSS。希望你能使用这个!
#sivHold {
background: #272733 url('http://s2.postimg.org/m59xr8lg9/Sivaas_BG.png');
padding: 20px;
width: 550px;
border: 10px solid #1e1e29;
}
#sivGIFHold {
background: url('http://s11.postimg.org/sq8bkw28x/Sivaas_Gif.gif');
/*background: url('http://s11.postimg.org/du9sdaqu9/Sivaas_Gif.gif');*/
height: 550px;
width: 550px;
text-align: center;
}
#sivPack {
background: rgba(30, 30, 41, 0.3);
padding: 10px;
border-radius: 37px;
height: 54px;
width: 54px;
margin-top: 50px;
display: inline-block;
}
#sivName {
font-family: Ubuntu;
font-size: 35px;
color: #dac4b3;
margin-top: 20px;
letter-spacing: 5px;
background: rgba(30, 30, 41, 0.8);
padding: 10px;
border-radius: 5px;
display: inline-block;
}
#sivMenu {
margin-top: -300px;
padding-left: 80px;
}
#sivMenu label {
background: rgba(59, 59, 73, 0.5);
padding: 10px;
float: left;
left: 1px;
font-family: Ubuntu;
font-size: 25px;
letter-spacing: 2px;
transition: 0.5s;
border-radius: 5px;
}
#sivMenu label:hover {
background: rgba(59, 59, 73, 0.8);
transition: 0.5s;
}
#titleTab1 {
color: #d1d97e;
}
#titleTab2 {
color: #c8ae9a;
}
#titleTab3 {
color: #272733;
}
#sivTabs {
position: relative;
clear: both;
padding: 5px;
margin-top: 100px;
}
#sivHold [type='radio'] {
display: none;
}
.sivTab {
display: none;
}
.sivContent {
background: #000;
padding: 20px;
padding-top: calc(20px - 1em);
border: 1px solid #272733;
color: #fff;
white-space: pre-line;
text-align: left;
}
#tab-1:checked ~ #sivTabs .sivTab:first-child,
#tab-2:checked ~ #sivTabs .sivTab:first-child + .sivTab,
#tab-3:checked ~ #sivTabs .sivTab:first-child + .sivTab + .sivTab {
display: block;
}
#tab-1:checked ~ #sivMenu label[for='tab-1'],
#tab-2:checked ~ #sivMenu label[for='tab-2'],
#tab-3:checked ~ #sivMenu label[for='tab-3'] {
background: #3b3b49;
}
<div id="sivHold">
<div id="sivGIFHold">
<div id="sivName">
<b>SIVAAS ⋄ GLAKEL</b><br /><span style="font-size:12px;display:inline-block;">SILVER GLADE CYPRESSMEN</span>
</div>
</div>
<input type="radio" id="tab-1" name="tab-group-1" checked="checked"/>
<input type="radio" id="tab-2" name="tab-group-1"/>
<input type="radio" id="tab-3" name="tab-group-1"/>
<div id="sivMenu">
<label for="tab-1" id="titleTab1">Threads</label>
<label for="tab-2" id="titleTab2">Orders</label>
<label for="tab-3" id="titleTab3">Upgrades</label>
</div>
<div id="sivTabs">
<div class="sivTab">
<div class="sivContent">
ACTIVE
[??] Thread Name located in Location
10 Reason
10 Reason
20 Total - Claimed/Unclaimed
INACTIVE
[??] Thread Name located in Location
10 Reason
10 Reason
20 Total - Claimed/Unclaimed
COMPLETED
[??] Thread Name located in Location
10 Reason
10 Reason
20 Total - Claimed/Unclaimed
</div>
</div>
<div class="sivTab">
<div class="sivContent">
ORDER FIVE
[X] Current Order!
ORDER FOUR
[o] [o] [o] [o] [o] Use magic in 5 threads
ORDER THREE
[o] Use magic during a hunt
[o] Train/Be-trained-by another character
[o] Purchase an additional spell
ORDER TWO
[o] Use magic against the Creature Account
[o] Use magic on a character not in your pack
[o] Use magic to help another character
[o] Use magic in 2 additional threads (not included in the above)
ORDER ONE
[o] Demonstrate one Customized Spell
[o] Use magic on 2 characters (not during training)
[o] Help train 2 wolves of a equal/lower order
[o] Use magic in 3 additional threads (not included in the above)
</div>
</div>
<div class="sivTab">
<div class="sivContent">
Total Biscuits Needed: XXXXB
MAGIC
Spell - XXXB
MUTATIONS
Mutation - XXXB
SKILL-TRAITS
Skill-Trait - XXXB
ITEMS
Item - XXXB
ARTIFACTS
Artifact - XXXB
ARMOR
Armor - XXXB
POTIONS
Potion - XXXB
TOKENS
Token - XXXB
</div>
</div>
</div>
</div>
关于html - 位置 :absolute not clearing, 仍然溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33459947/
我正在尝试获取从过去的 startposition/location 到当前移动的 currentposition/location 的距离(以米为单位)。 我确实有工作正常的currentposit
所以我有一堆绝对覆盖的 div。用户通过在叠加层上拖动来创建方形 div。如果您要创建一个 div,然后放大和缩小,div 会保持在同一位置,因为它对叠加层是绝对的,如前所述。 然而问题就出在这里。您
我想找到 View 在显示屏幕上的位置。 为此,我使用了 view.getLeft() 、view.getBottom() 、view.getRight() 等方法> , view.getTop()。
我有一个看起来像这样的 View 层次结构(基于其他答案和 Apple 的使用 UIScrollView 的高级 AutoLayout 指南): ScrollView 所需的2 个步骤是: 为 Scr
所以我有一个名为 MARKS 的表,我有这些列 STUDENT_ID, CLASSFORM_NAME, ACADEMIC_YEAR, TERM, SUBJECT_NAME, TOTAL_MARKS
我有一个问题我无法理解,请帮助: 我开发了带有图像的 html 页面,并使用 jQuery UI 帮助使它们可拖动,我将这些图像位置设置为相对位置并给出了左侧和顶部像素,这是页面的链接 http://
我正在尝试创建一个 CSS 动画,它在 sprite 表中循环播放 16 个图像,给人一种幽灵“漂浮”的错觉。动画通过在 background-position 位置之间移动以显示不同状态的幽灵来实现
我正在创建这个网站的 WebView https://nearxt.com/打开时询问位置但是当我使用此链接在 flutter 中创建 webview 时那么它就无法定位我还在应用程序中定义了位置,但
我正在以编程方式创建一个需要跨越 2 个屏幕的窗口。正在创建的窗口的大小是正确的,但窗口大约从第一个屏幕的一半开始。我可以将它拖回第一个屏幕的开头,NSWindow 非常适合。 我只需要知道在窗口的起
位置“/”的匹配叶路由没有元素。这意味着默认情况下它将呈现一个空值,从而导致一个“空”页面 //App.js File import { BrowserRouter as Router, Routes
我有一个运行 Ubuntu 和 Apache 的 VPS 例如,假设地址是:5.5.5.5 在 VPS 上,我有一个名为 eggdrop 的用户(除了我的 root 用户)。 用户 eggdrop 有
我有一个 JLabel与 ImageIcon ,我使用 setIcon() JLabel中的函数. ImageIcon然后上来,坐在我的JLabel 的文字左侧.是否有可能拥有 ImageIcon在文
我的图中有节点,它们的 xlabels 位于它们的左上方。我怎样才能改变这个位置?我希望 xlabels 正好位于节点本身的旁边。 最佳答案 xlp是你想要的属性,但它没有做任何事情。 你不能改变位置
我对基本的 VIM 功能有疑问:(我尝试谷歌搜索但找不到答案) 如何列出所有自定义功能。(我做了 :function 并且不能找到我的自定义函数) 如何获得自定义函数列表中的函数(或它们的存储位置)。
我是 PHP 的新手,虽然我一直在搜索,但我不知道该怎么做。 我知道可以使用 Location("some page") 进行重定向。我还读到,只要没有向用户显示任何内容,它就可以工作。 我想做的是:
如果在 jgrowl.css 中位置更改为“center”,我如何将其覆盖为默认值,即“top-right” $.jGrowl(data, { header: 'data', an
我需要根据用户是否滑动屏幕顶部、屏幕中间或屏幕底部来触发不同的事件。我正在尝试找出最好/最简单的方法来做到这一点,因为我很确定没有办法从 UISwipeGestureRecognizer 获取位置。
我需要枚举用delphi编写的外部应用程序中使用的类 ,因此我需要访问VMT表以获取该信息,但是我找不到任何有关如何在exe(由delphi生成)文件中找到VMT(虚拟方法表)的位置(地址)的文档。
在 D2010 (unicode) 中是否有像 Pos 这样不区分大小写的类似函数? 我知道我可以使用 Pos(AnsiUpperCase(FindString), AnsiUpperCase(Sou
我正在尝试为我的reveal.js 演示文稿制作一个标题,该标题会粘贴在屏幕顶部。标题中的内容在每张幻灯片的基础上都是动态的,因此我必须将标记放在 section 标记中。 显然,如果标记在 sect
我是一名优秀的程序员,十分优秀!