gpt4 book ai didi

css - CSS 中的 float 问题

转载 作者:行者123 更新时间:2023-11-27 23:37:36 25 4
gpt4 key购买 nike

正如您在链接上看到的,有两个文本是粘性的。...»Dernek Haber 1管理员于...

我想将这些文本彼此分开,以“By admin”开头的文本将向右浮动。

https://dernek1.deniz-tasarim.site/2019/07/22/dernek-haber-1/如何解决?

        <style>
.breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;

}
.breadcrumb a {
color: #428bca;
text-decoration: none;
}





</style>
<?php

function get_breadcrumb() {
echo '<a href="'.home_url().'" rel="nofollow">Home</a>';
if (is_category() || is_single()) {
echo "&nbsp;&nbsp;&#187;&nbsp;&nbsp;";
the_category(' &bull; ');
if (is_single()) {
echo " &nbsp;&nbsp;&#187;&nbsp;&nbsp; ";
the_title();
}
} elseif (is_page()) {
echo "&nbsp;&nbsp;&#187;&nbsp;&nbsp;";
echo the_title();
} elseif (is_search()) {
echo "&nbsp;&nbsp;&#187;&nbsp;&nbsp;Search Results for... ";
echo '"<em>';
echo the_search_query();
echo '</em>"';
}
}
?>
<div class="breadcrumb"><?php get_breadcrumb(); ?>

<div style="float:right; display:block;">By <?php the_author_posts_link(); ?> on <?php the_time('F jS, Y'); ?> in <?php the_category(', '); ?> <?php edit_post_link(__('{Edit}'), ''); ?></div>

</div>

最佳答案

只需要在“By admin...”div中添加margin-left: auto;即可解决。

像这样:

<div style="margin-left: auto;">By ... </div>

关于css - CSS 中的 float 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57174770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com