简体   繁体   English

垂直对齐不同的段落

[英]Align vertically different paragraphs

I am working with this website created with Drupal www.crincon.com. 我正在使用这个由Drupal创建的网站www.crincon.com。 The section under the slides, contains several blocks with nested divs elements and a link at the end. 幻灯片下面的部分包含几个带有嵌套divs元素的块,并在末尾有一个链接。

Block caption 标题栏

What I would like to do is that the links "Read More" (with button aspect) will be all at the same height, with the same vertical alignment for all the blocks, to be displayed at the same level. 我想做的是,“更多”链接(具有按钮外观)将全部位于相同的高度,并且所有块的垂直对齐方式都将显示在同一级别。

The HTML for all the blocks looks like this: 所有块的HTML如下所示:

 <div class="column one"> <div class="region region-top-first"> <div id="block-block-7" class="block block-block"> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization to the market of Russia, CIS and Baltic States</h2> <p><a href="en/services/localization">Read more</a></p> </div> </div> <!-- /.block --> </div> <!-- /.region --> </div> 

I have tried many different options looking at some responses here (like relative-absolute position), but with no success. 我尝试了许多不同的方法来查看此处的一些响应(例如相对绝对位置),但没有成功。

Thank you! 谢谢!

position the read more button like below code. 像下面的代码一样放置更多按钮。 I add a class .readmore to the button. 我将一个类.readmore添加到按钮。

.readmore {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
 }
.content {
    position: relative;
}

You may use flex to make this easy : 您可以使用flex来简化此操作:

 .block { display:flex; flex-wrap:wrap } .content { text-align:center; padding:1em; background:#0194CA; box-shadow:inset 0 0 1px,inset 0 0 40px white; width:15%; min-width:150px; /* what does the thing you want , stands here below , but parent has to be a wrapping flex element : */ display:flex; flex-flow:column; justify-content:space-between; } 
 <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.min.css" rel="stylesheet"/> <div id="block-block-7" class="block block-block"> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization to the</h2> <p><a href="en/services/localization">Read more</a></p> </div> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization to the market of Russia, </h2> <p><a href="en/services/localization">Read more</a></p> </div> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization</h2> <p><a href="en/services/localization">Read more</a></p> </div> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization to the market of Russia, CIS and Baltic States</h2> <p><a href="en/services/localization">Read more</a></p> </div> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization Baltic States</h2> <p><a href="en/services/localization">Read more</a></p> </div> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization to the market of Russia, CIS and Baltic States</h2> <p><a href="en/services/localization">Read more</a></p> </div> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization to the market of Russia, CIS and Baltic States</h2> <p><a href="en/services/localization">Read more</a></p> </div> <div class="content"> <p><i class="fa fa-flag fa-6" aria-hidden="true"></i></p> <h2>Localization to the market of Russia, CIS and Baltic States</h2> <p><a href="en/services/localization">Read more</a></p> </div> </div> 

this might help you somehow. 这可能会以某种方式帮助您。

#top-area a {
    color: #ECF9FD;
    border: 1px solid #92DAF5;
    padding: 5px 10px;
    border-radius: 3px;
    position: absolute;
    bottom: 20px;
    left: 20%;
    right: 20%;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM