【发布时间】:2018-12-02 03:27:47
【问题描述】:
在呈现不在我的源代码中的 DOM 时会出现换行符,将内容推到不合适的位置。为什么?我该如何解决这个问题?这是我的代码:
<div class="float-left" style="position:relative;left:15px">
<h2 style="color:#323C41;margin-bottom:0;">A New Hope</h2>
<p style="color:#323C41;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vehicula nisl at hendrerit ornare. Ut non ipsum urna. Praesent non.</p>
</div>
当我在 Chrome 中检查页面时,它会显示:
<div class="d-flex justify-content-center align-items-center bg-grey-kr fg-navy-kr secondary">
<br>
<img src="/images/testers/rebels.png" alt="Rebel symbol" class="rebel"><br> <div class="float-left" style="position:relative;left:15px">
<br>
<h2 style="color:#323C41;margin-bottom:0;">A New Hope</h2>
<br>
<p style="color:#323C41;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vehicula nisl at hendrerit ornare. Ut non ipsum urna. Praesent non.</p>
<br>
</div>
感谢您查看此内容。我搜索了一上午,找不到答案。如果很明显,请提前道歉!
【问题讨论】:
-
我们需要看到minimal reproducible example 才能相信会发生这种情况。
-
我应该提供页面的完整代码吗?我不知道为什么会这样,所以我不确定如何复制它。我试图用尽可能少的代码来解释问题,同时对我正在做的事情保持透明。
标签: html bootstrap-4 markdown hexo