Reputation: 828
I'd like to achieve the following:
but it's bleeding from several wounds:
#div1
to top.#div2
, so like h3
and h4
What I can do so far: http://jsbin.com/ivemal/30/
The html code:
<ul>
<li>
<div id="div1">
<h3> Title </h3>
<h4> SubTitle </h4>
</div>
<div id="div2">
...
</div>
</li>
<li>
...Same...
</li>
...
</ul>
I think the root cause I can't achieve this, is the rotated text. Can someone guide me, how to handle this problem?
Thanks in advance!
Upvotes: 2
Views: 211
Reputation: 46287
<div id="outer">
<div id="inner"> <div>
<h3>text</h3>
<h4>text2</h4>
</div>
</div>
<div id="inner2">Other text...</div>
</div>
I changed the span
to a div
because technically you cannot have block-level elements (i.e. headings) within a span
.
html, body {
margin: 0;
}
#outer {
background: green;
}
#inner {
background:#e3e3e3;
height:100px;
width:50px;
float: left;
}
#inner > div {
-webkit-transform: rotate(-90deg);
transform: rotate(-90deg);
line-height: 0;
}
#inner2 {
margin-left:70px;
background:#e3e3e3;
}
#inner2::after {
display: table;
content: '';
clear: both;
}
See jsFiddle.
Upvotes: 3
Reputation: 25
I don't know if I understood correctly, but is this what you want to obtain?
Upvotes: 0