0
我正在努力嘗試弄清楚如何將#book3放置在#content-body-container的底部並將文本包裝在#book3的周圍。我無法在#book3上使用頂部邊距,因爲文本不會環繞它。我需要的方法是跨瀏覽器兼容,也可以在舊版瀏覽器中使用。我想純HTML/CSS的解決方案,如果可能的將div對齊到包含div的底部,並將文字圍繞底部div
小提琴可用here
<html>
<head>
<style>
#content {
width: 960px;
height: 600px;
margin: 0;
}
#content-body-container {
position: relative;
float: left;
top: 28px;
width: 495px;
border: 1px solid black;
height: 462px;
}
#book3 {
position: relative;
float: left;
/*margin-top:117px;*/
/*top: 145px;*/
bottom: 0;
height: 345px;
width: 88px;
background-color: #ffe3b1;
}
#book1 {
position: relative;
float: left;
top: 61px;
bottom: 0;
height: 429px;
width: 79px;
margin-right: 16px;
background-color: #ffd48b;
}
#book2 {
position: relative;
float: left;
top: 28px;
bottom: 0;
height: 462px;
width: 28px;
margin-right: 12px;
background-color: #ffc664;
}
#link-book1 {
position: absolute;
bottom: 54px;
}
#link-book3 {
position: absolute;
margin-left: 2px;
bottom: 16px;
}
</style>
</head>
<body>
<div id="content">
<div id="content-body" class="content-wrapper">
<div id="book1">
<a href="#" id="link-book1" class="book-link">Book 1</a>
</div>
<div id="book2"></div>
<div id="content-body-container">
<div id="book3">
<a href="#" id="link-book3" class="book-link">Book 3</a>
</div>
<div id="content-body-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla.
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa.
Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet.
Suspendisse in justo eu magna luctus suscipit. Integer euismod lacus luctus magna. Quisque cursus, metus vitae pharetra auctor, sem massa mattis sem, at interdum magna augue eget diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi lacinia molestie dui.
</div>
</div>
</div>
</div>
</body>
</html>