これは私がStackOverflowの投稿から取った例です。同様の効果が欲しいですが、divの上にマウスを置くと拡大します。しかし、私はページがCSSだけを介して読み込まれるときに展開したい。私はjqueryを通してそれを達成することができますが、私はそれだけでCSSを使ってやりたがっています。誰も助けることができますか?divを100%の幅に拡大
.wrapper {
background:#DDD;
display:inline-block;
padding: 10px;
height: 20px;
width:auto;
}
.label {
display: inline-block;
width: 1em;
}
.contents, .contents .inner {
display:inline-block;
}
.contents {
white-space:nowrap;
margin-left: -1em;
padding-left: 1em;
}
.contents .inner {
background:#c3c;
width:0%;
overflow:hidden;
-webkit-transition: width 1s ease-in-out;
-moz-transition: width 1s ease-in-out;
-o-transition: width 1s ease-in-out;
transition: width 1s ease-in-out;
}
.wrapper:hover .contents .inner {
width:100%;
}
<div class="wrapper">
<span class="label">+</span><div class="contents">
<div class="inner">
These are the contents of this div
</div>
</div>
</div>
ありません私はそれが100%の幅 – Alexu
[OK]を5分0%の幅からなるときにページが読み込ま私はそれまで休まオーケーコード –
を与えることを望んなし! :D – Alexu