gpt4 book ai didi

html - 位置 :absolute not clearing, 仍然溢出

转载 作者:行者123 更新时间:2023-11-28 06:56:56 25 4
gpt4 key购买 nike

我在这里设置了一个 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 &diam; 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/

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