gpt4 book ai didi

css - 长 URL 不会留在 Bootstrap 列中

转载 作者:行者123 更新时间:2023-11-28 15:22:39 25 4
gpt4 key购买 nike

我正在使用 Bootstrap 网格开发 WordPress 主题,我在移动 View 中发现了一个问题。一切都固定在 Bootstrap 列中,但引用部分中有一些链接不留在列内,弄乱了我的网格并创建了一个水平滚动条:

enter image description here

enter image description here

我已经尝试了所有方法,但没有任何效果,我需要帮助。

这是 single.php 中的代码:

<div class="c-content-box c-size-md" style="margin-top:4%;">
<div class="container">
<div class="row">

<div class="c-content-blog-post-card-1-grid">
<div class="row">

<div class="col-md-12">
<div class="col-md-8 wow animate fadeInLeft">

<div class="c-media 2 img">
<div class="c-overlay-wrapper">
<div class="c-overlay-content">
<?php the_post_thumbnail( '', array( 'style' => 'max-width:100%; height:auto;' ) ); ?>
</div>
</div>
</div>

<?php
while ( have_posts() ) : the_post();

get_template_part( 'template-parts/content', get_post_format() );

?>

<div class="col-md-12 c-margin-b-60">
<?php
the_post_navigation( array(
'prev_text' => '<button type="button" class="col-md-5 col-md-offset-1 col-xs-6 btn btn-md c-btn-red c-btn-square ">Post Anterior</button>',
'next_text' => '<button type="button" class="col-md-5 col-md-offset-1 col-xs-6 btn btn-md c-btn-red c-btn-square ">Próximo Post</button>',

));

?>
</div>

<?php
echo '<div class="col-md-12 c-margin-t-20">';

// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;

endwhile; // End of the loop.
echo '</div>'
?>

</div>



<div class="col-md-4 ">
<div class="col-md-12 wow animate fadeInRight" >
<?php get_sidebar(); ?>
</div>
</div>



</main><!-- #main -->
</div><!-- #primary -->
</div>
</div>
</div>
</div>
</div>

最佳答案

您需要添加一些 CSS 来自动换行您的文本。

div {
width: 100px;
border: 1px solid black;
margin: 5px;
}
.wrapped {
word-wrap: break-word;
}
<div>https://stackoverflow.com/questions/45800283/content-posts-doesnt-stay-inside-the-bootstrap-cols</div>

<div class="wrapped">https://stackoverflow.com/questions/45800283/content-posts-doesnt-stay-inside-the-bootstrap-cols</div>

关于css - 长 URL 不会留在 Bootstrap 列中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45800283/

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