我有以下代碼。我正在嘗試在段落所在的位置右下方添加鏈接。在文本底部放置一個鏈接
.allParent{
background-color:gray;
padding:10% 20%;
}
.titleAll{
width:100%;
padding-top:5px;
background-color:#fff;
text-align:center;
}
.titleAll h4{
color:gray;
margin:0;
}
.parent {
display: flex;
flex-direction: row;
padding: 10px;
background-color:#fff;
text-align:left;
}
.parent .child {
padding-right: 10px;
flex-grow: 1;
width:50%;
font-size:80%;
}
.parent .child:last-child {
padding-right: 0;
}
.contentRight{
position:absolute;
bottom:30px;
right:371px;
}
.allParent{
background-color:gray;
padding:10% 20%;
}
.titleAll{
width:100%;
padding-top:5px;
background-color:#fff;
text-align:center;
}
.titleAll h4{
color:gray;
margin:0;
}
.parent {
display: flex;
flex-direction: row;
padding: 10px;
background-color:#fff;
text-align:left;
}
.parent .child {
padding-right: 10px;
flex-grow: 1;
width:50%;
font-size:80%;
}
.parent .child:last-child {
padding-right: 0;
}
.contentRight{
position:absolute;
bottom:30px;
right:371px;
}
<div class="allParent">
<div class="titleAll">
<h4>Cats description</h4>
<div>
<div class="parent">
<div class="child">
<div class="content">
<img src="http://www.cutestpaw.com/wp-content/uploads/2016/02/s-Schrodinger-as-a-kitten..png" style="width:100%">
</div>
</div>
<div class="child">
<div class="content">Cats are similar in anatomy to the other felids, with a strong flexible body, quick reflexes, sharp retractable claws, and teeth adapted to killing small prey. Cat senses fit a crepuscular and predatory ecological niche. Cats can hear sounds too faint or too high in frequency for human ears, such as those made by mice and other small animals.</div>
<div class="contentRight"><a href="">LINK HERE</a></div>
</div>
</div>
<div class="titleAll">
<h4>Cats description</h4>
<div>
<div class="parent">
<div class="child">
<div class="content">
<img src="http://www.cutestpaw.com/wp-content/uploads/2016/02/s-Schrodinger-as-a-kitten..png" style="width:100%">
</div>
</div>
<div class="child">
<div class="content">Cats are similar in anatomy to the other felids, with a strong flexible body, quick reflexes, sharp retractable claws, and teeth adapted to killing small prey. Cat senses fit a crepuscular and predatory ecological niche. Cats can hear sounds too faint or too high in frequency for human ears, such as those made by mice and other small animals.</div>
</div>
</div>
</div>
現在下的每個<div class="content">
我在哪裏描述有關圖像,我試圖提供在該段右下方兩個環節。我在第一個描述中試圖做到這一點,但它一直在右側。但我只是希望它在背景爲白色的文本下最右邊。
感謝您的建議。但是,這裏的鏈接應該只在白色背景的最右邊,並且在文本的下面。我在你的建議中看到它的最左邊和最下面的文字 – user3750720
@ user3750720編輯 –
@ user3750720添加這個來爲你的錨定標記「display:block; float:right;」添加樣式。 –