0
A
答えて
0
私はあなたのHTML/CSSの構造を確認していない、またはあなたのコードは次のようになりますが、ここで私が書いた例であるかもしれないもの。
* {
box-sizing: border-box; /* Set the box sizing for easier margins/paddings. */
}
html,
body {
margin: 0; /* Demo style. */
background: #95a5a6; /* Demo style. */
}
.container {
width: 50%; /* Demo style. */
margin: 50px auto; /* Demo style. */
background: white; /* Demo style. */
font-family: arial; /* Demo style. */
font-size: 16px; /* Demo style. */
}
/* The parent of the rotated text. */
.box {
position: relative; /* Relative for the absolute childs. */
background: #c0392b; /* Demo style. */
color: white; /* Demo style. */
padding: 10px; /* Demo style. */
height: 200px; /* Static height is required. */
}
/* The rotated text */
.box span {
width: 200px; /* Must be the same as the height of the .box div. */
-webkit-transform-origin: 90px 100px; /* These values will need to be changed depending on your width of this span, and height of it's parent. */
display: inline-block; /* Set the display of the span to be in the block flow. */
-webkit-transform: rotate(-90deg); /* Rotate the text span. */
background: #2980b9; /* Demo style. */
text-align: center; /* Center the text. */
padding: 10px; /* Demo style. */
float: left; /* Make the rotated text be on the left most part of the parent. */
}
/* Other content that can be beside the rotated text */
.content {
position: absolute; /* So the content is not affected by the rotated text. */
margin: 0 0 0 30px; /* Push the content from the left so it is not behind the rotated text. */
top: 0; /* Push the content to the top of the parent. */
padding: 0 10px; /* Demo style. */
}
<div class="container">
<div class="box">
<span>JS</span>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis culpa laborum suscipit, laudantium ut recusandae architecto modi natus incidunt, consequuntur ea quas quod nisi nobis possimus nostrum, porro neque saepe.</p>
</div>
</div>
</div>
+0
うわー!!これは私が探していたものであり、これは私の構造がどのようなものなのかです。ありがとう@オーステン – MAC
関連する問題
- 1. divを縦に並べる
- 2. 縦中央テキスト - 不明divの寸法
- 3. htmlで縦列に並んだテキストを作る方法は?
- 4. 図の中にテキストを縦に並べる方法は?
- 5. 縦中心:: divの後
- 6. CSS段落/ divの縦方向にテキストを中央に...?
- 7. div内にこのテキストを縦に並べることができません
- 8. div内の縦の中心div
- 9. divの真ん中に縦のグラフバーを表示する
- 10. ページの縦方向の中心div
- 11. divの縦と横の中心ul
- 12. HTML5とCSS3:縦揃えDIV内のテキスト
- 13. テキストと縦方向に並んだインラインイメージを作成する方法は?
- 14. 真ん中の縦に整列するインラインブロックdiv
- 15. オーバーフローが隠されているdivのテキストを縦に並べる方法は?
- 16. さまざまなdivの中央にテキストを縦に整列する
- 17. 縦方向にテキストを列divの中央に配置します
- 18. 私のdivが縦に真ん中に並んでいないのはなぜですか?
- 19. 画像の横にテキストを縦に並べる方法は?
- 20. インラインの内側にテキストを縦に並べる
- 21. Diaの縦のテキスト
- 22. div要素の縦横のテキストを中央に揃える方法
- 23. セルの中央にビデオを縦に並べる方法は?
- 24. イメージの横に縦のテキストを並べ替えます
- 25. CSS縦テキスト
- 26. 縦書きテキスト
- 27. 縦の中央に2つのdivが並んでいる場合は何もありません。
- 28. テキストの縦線がdivで機能していませんか?
- 29. input type = "text"のテキストを縦に並べる方法は?
- 30. 列のテキストを縦に並べる方法は?
http://stackoverflow.com/questions/39416776/vertical-text-with-vertical-align-middle-in-a-divあなたがこれを読んで持っていますか? – s0rfi949
テキストの方向はどのように達成していますか? – mm759
3番目の画像の作成に使用したコードを表示してください。答えは、縦書きテキストの実装方法によって異なります。 – YakovL