- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
用一个具体的例子重新表述了这个问题。几乎没有办法重新打开它,所以我创建了一个新问题。
在我管理的网站上,有一行文字悬空。我制作了一个 JSFiddle 来表示正在发生的事情。如果人们想访问它,我还将包括该站点。
你可以在“这是巴尔在他新秀赛季的训练营期间签名”这一行看到我在说什么。在 JSFiddle 中。我要year.
在 Here
下, 不在 div 下。
这只发生在某些情况下——比如上面的 <p>
标记运行,其中一部分位于相关广告下方。
如果有一种方法可以使该行的后半部分不单独出现,我的客户会更喜欢。有没有办法让一个<p>
被漂浮在它左边的东西移过的标签保持移过,即使 <p>
的后半部分也是如此。标签在技术上可以有全宽吗?
我已经尝试了很多不同的东西,但到目前为止没有任何效果。任何帮助将不胜感激。
#block-inject-1 {
width: 200px;
float: left;
height: 200px;
background-color: red
}
<div class="field-item even" property="content:encoded">
<p>Here is iFolloSports.com original video of <a href="http://ifollosports.com/nfl/vikings-star-anthony-barr-promoting-his-charity-steps-ucla-videos">Vikings Pro Bowl linebacker Anthony Barr </a>signing autographs. This event was organized by
<a href="http://www.cravetheauto.com/" target="_blank">Crave Sports Company</a> and held Tuesday night at Bald Man Brewing, in the Twin Cities suburb of Eagan, Minnesota.</p>
<p>Barr is now in his fourth NFL season, amid appearing in the Pro Bowl each of the last two years. Thus far in 2017, the Vikings are 2-1, with Barr contributing 20 combined tackles (14 solo), in this early season. For his career, Barr has amassed 228
combined tackles (160 solo) and 9.5 sacks.</p>
<p></p>
<p>In addition to Tuesday’s gathering, iFolloSports.com has provided multiple behind the scenes looks at Barr, in both Minnesota and his hometown of Los Angeles.</p>
<p></p>
<div id="block-inject-1" class="block-inject block-inject-1">AD HERE</div>
<p>Here is Barr, at a restaurant near his alma matter of UCLA, <a href="http://ifollosports.com/nfl/vikings-star-anthony-barr-promoting-his-charity-steps-ucla-videos">interacting with patrons and signing autographs</a>. The appearance was on behalf of
his
<a href="http://www.anthonybarr55.com/" target="_blank">Raise the Barr Foundation</a>, which focuses on assisting single mothers in their efforts to pursue higher educational opportunities. </p>
<p>Just a few weeks later, Barr and his mother Lori, hosted a food and wine-pairing event, at The Ritz-Carlton Residences in downtown LA, with <a href="http://ifollosports.com/nfl/vikings-anthony-barr-hosts-charity-gala-and-speaks-ifollosportscom-video">iFolloSports.com providing full coverage of the gala, including a wide-ranging interview</a> with the 25-year-old LB.</p>
<p><a href="http://ifollosports.com/nfl/cassel-bridgewater-greenway-ap-barr-vikings-camp-videos">Here is Barr signing autographs during training camp his rookie year</a>.</p>
<p><a href="http://ifollosports.com/nfl/solid-rookie-anthony-barr-signing-video">This clip displays the UCLA alum appearing at an autograph event, also during his rookie campaign</a>.</p>
<p> </p>
</div>
我想要一个解决方案,其中 year.
和 Here
靠近广告底部的同一位置开始。我不要其他的<p>
受此影响的标签,这必须在动态系统中工作,我不知道有多少 <p>
标签将存在。
这是一张图片:
最佳答案
不直观,但您可以通过添加以下 CSS 获得所需的结果:
p {
overflow: hidden;
}
这将防止段落在 float div 下换行。
查看此 fork of your fiddle进行演示。
添加了更多信息以回应您的评论:
如果您还有恰好位于广告右侧的右浮动 div,您可能会遇到广告和右浮动 div(例如图片)之间只有非常狭窄的水平空间的问题.从那里开始的段落将非常狭窄。由于段落设置为 overflow hidden ,如果段落足够窄,甚至可能会窄到一个字符都显示不出来(因此看起来段落消失了)。
一个解决方案是为您的段落添加一些最小宽度。这会导致段落向下跳一点,直到至少有那么多的水平空间可用于文本 - 因此它会出现在右栏中的图像下方。
将此限制为仅相关段落而不是页面上的所有 p 标记可能也是一个好主意,因此您可能希望对选择器进行更多限制。例如:
.field-item p {
overflow: hidden;
min-width: 200px;
}
至于为什么文本会跳来跳去:我发现当您向空段落添加 overflow: hidden
时,空段落的行为会发生变化。消失的段落下的段落跳跃很多,因为那个“太窄”段落的自动换行导致每个单词都在一个新行开始 - 因此极大地增加了它的高度。
关于html - 悬挂文字行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46480484/
我试图使用 2 个文件描述符让父级向子级发送信息,并让子级将其发回。 #include #include #include #define READ 0 #define WRITE 1 int
我需要摆脱警告,其中之一是 -Wdangling-else。它在以下宏定义中记录了一个悬空 if: #define FOR_EACH_REF(var, container) \ if(bool
我使用eclipse进行php开发。我最近遇到了一个问题,IDE 会挂起,并且每当我打开 eclipse 时就会立即返回挂起状态。它说它卡在“初始化Java工具”上。我重新安装了多个版本的java和e
我想使用队列来保存结果,因为我希望消费者(串行而不是并行)在工作人员产生结果时处理工作人员的结果。 现在,我想知道为什么以下程序挂起。 import multiprocessing as mp imp
我是 ruby/rails 的新手,过去 2 天一直被一个问题搞得头晕目眩,希望这个论坛上的人能帮助我解决这个问题。 我正在使用 Rails 4 并使用 Passenger + Nginx 和 M
在堆上释放内存后 - vector 中仍保留(悬空)指针。如何完全删除 vector 元素? vector obstacles; vector actions; void Game::free(Ga
在编译器构造中,主要的歧义问题之一是dangling else。正如 Aho、Lam、Sethi 和 Ullman 在《编译器:原理、技术和工具》一书中提到的,悬空 else 的语法不能与 LL(1)
细节: ? Workspace name (e.g., org name) swag
我是一名优秀的程序员,十分优秀!