画像とテキストを含む要素があり、
フィドル。注: グリッドが十分に大きくなるようにプレビューのサイズを変更します。
ここに私のCSSがあります:
.gridster .gs-w .item{
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.gridster .gs-w .item .obj{
background-color: #00A9EC;
}
.gridster .gs-w .item .itemIcon {
height: 100%;
width: 100%;
float:left;
overflow: hidden;
z-index: 10;
}
.gridster .gs-w .item .itemIcon {
background-image: url(http://icons.iconarchive.com/icons/dakirby309/windows-8-metro/256/Apps-Calendar-Metro-icon.png);
background-repeat:no-repeat;
background-size:contain;
align-content: center;
}
.gridster .gs-w .item .itemText{
display: block;
width: 100%;
position: relative;
margin-right: 0px;
right: 0px;
text-align: right;
z-index: 9;
}
.gridster .gs-w .item .itemText a{
vertical-align: center;
text-align:right;
color:white;
padding-right: 10%;
font-size: 14px;
font-weight: 600;
text-decoration:none;
font-family: 'Segoe UI';
}
要素が展開されているときにテキストを表示し、要素が折りたたまれているときに非表示にしたい、CSSで実現できると思いますが、何が間違っているのかまだ明確ではありません.
そしてここでそれは折りたたまれています
可能であればCSSで作成できる場合に備えて、いくつかのCSSコードをアドバイスしてください。