Pho3nixHun
Pho3nixHun

Reputation: 828

Rotated text behaves strange

I'd like to achieve the following:enter image description here

but it's bleeding from several wounds:

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

Answers (2)

rink.attendant.6
rink.attendant.6

Reputation: 46287

HTML

<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.

CSS

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

Chinciusan Marian
Chinciusan Marian

Reputation: 25

I don't know if I understood correctly, but is this what you want to obtain?

http://jsbin.com/ivemal/38/

Upvotes: 0

Related Questions