我遇到了一些div的位置和佈局問題。如何組織這種佈局溢出?
我想要的佈局:
我想要的標題總是出現在充分和正確的。字幕應該出現在左側,但任何隱藏的溢出,所以標題的長度總是先例。
我有以下代碼:
<html>
<head>
<style type="text/css">
.title {height: 25px; text-align:left; width: 300px; border:1px solid red;}
.subtitle {height: 20px; overflow:hidden; float:left; border: 1px solid blue;}
</style>
</head>
<body>
<div class="title">
Title number 1
<div class="subtitle">This is subtitle that is longer with even more text</div>
</div>
</body>
</html>
在分鐘,如果字幕太長,它只是徘徊下方。 任何想法?
我認爲它會更有意義,對正確的左側的標題和副標題。 – thirtydot
謝謝,但我用「title」和「subtitle」替換了我的真實數據。你說得對,不好的例子! – penpen