- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一张图片,我希望其中的一些文字环绕。我通过给出负的最高值并使其位置相对来将图像放置得更高一些。但它在图像下方显示了一些空白。我想删除带有文本的空白。我怎样才能做到这一点?
这是html代码
.what_text_container>p {}
.what_text_container>p>span {
font-style: italic
}
.what_text_container>img {
border-radius: 15px;
float: right;
position: relative;
top: -150px;
}
<div class="what_text_container">
<img src="assets/images/carolina.png" width="324" height="215" alt="" />
<p>
<span>"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.</span>
<br> "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder
of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves
or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical
exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"<br>
<br> "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder
of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves
or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example,<br>
<br> "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder
of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves
or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical
exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
</p>
</div>
最佳答案
删除顶部属性。
像这样保持你的CSS。
.what_text_container > p {
}
.what_text_container > p > span {
font-style:italic
}
.what_text_container > img {
border-radius: 15px;
float: right;
position: relative;
}
或删除位置:
.what_text_container > p {
}
.what_text_container > p > span {
font-style:italic
}
.what_text_container > img {
border-radius: 15px;
float: right;
margin-top: -150px;
}
关于html - 如何将文字环绕在图像周围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26570602/
我目前有一堆看起来像这样的行: txt = "Can't print the value for "+arguments[1]+" before it's set"; 我在做 $('#mydiv').
我有一个网站,我试图以移动格式显示,但在宽屏幕上显示。我确信 iframe 是要走的路。 我正在尝试将 iframe 加载到 iPhone 的图像中。你可以看到一个例子 here . 一旦你看到它,你
我正在尝试使用 Xcode 中的 Storyboard创建如下所示的 View 。 为此,我添加了一个按钮和一个带有约束的标签,但这就是我得到的结果。文本不会从复选框下方开始。实现此目的的一种方法是创
我正在与 css 斗争以将文本包装在 div 中。我应用了空格、分词但没有任何反应。 链接 http://fiduciaryconsulting.org/index.php/services/90-s
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
正如标题所说 - 如何将文本环绕在伪元素周围?请参见下面的示例: .area { position: relative; } .area:before { content: '';
每次我尝试在 CSS 中做一些看似简单的事情时,它都行不通。 我有一个包含 460x160 图像的内容 div。我想做的就是将图片放在右下角,然后用文字环绕它。 text text
每次我尝试在 CSS 中做一些看似简单的事情时,它都行不通。 我有一个包含 460x160 图像的内容 div。我想做的就是将图片放在右下角,然后用文字环绕它。 text text
我有一个流式布局,它已经为我工作了一段时间。我漂浮 不是右就是左。一个 div 通常会有一个图像和一个标题。 文本项正确地环绕在 float 周围。但是某些元素没有: 将做以下两件事之一:他们要么侵入
这是我的问题。我在另一个 div 中有内联 block div。 .timeEvents { width: 100%; overflow: hidden; text-align: cent
使用float,我可以让文本环绕figure标签中的图像,而不是环绕figcaption标签,因为出色地。将 float 添加到 figcaption 不会这样做。有什么建议吗? 下面的代码在这里:h
如何让 div 2 环绕 div 1 ? (两个 div 都包含文本) +---++------------------+ | || | | 1 ||
我有一个场景,我需要转换一个可以被 *this 链接的函数返回 std::optional>而不是 T& (原因超出了这个问题的范围)。我使用 std::reference_wrapper 的原因是因
我想我彻底搜索了这个网站,但找不到我的问题的答案;我也认为这很简单,但是经过几个小时的困惑之后,我已经放弃并决定寻求帮助...... 这是我的问题;我有一个 DIV,里面有两个 DIV;第一个 DIV
我有一个文本区域字段,其右上角有一个 div 框。我进行了广泛的搜索,但找不到一种方法可以让输入文本区域的文本环绕 div。 #wrapper { position: relative; wi
所以我在使用 FancyBox 时遇到了这个问题,当滚动页面主体(主页)时,框会随机向左和顶部移动位置。 附上 GIF 演示问题: 据我所知,我正在使用 Fancybox v2。 网址是here (在
我的 coinslider 周围有一个容器 div。我想围绕这个容器 div 包装文本。如何实现这一目标? 现在我的 HTML 设置如下: 我的 CSS 是这样设置的: #mycontain
每次我尝试在 CSS 中做一些看似简单的事情时,它都行不通。 我有一个包含 460x160 图像的内容 div。我想做的就是将图片放在右下角,然后用文字环绕它。 text text
我有一个名为“content”的 DIV,其中我有一个图像作为边框/框架,我想绕过它。我都有一个大的整个框架(左、右、上、下),它与它应该的宽度相匹配,而且我把它切碎了,所以我有四个单边框图像(lef
我正在使用 fieldset 在 div 周围创建带标题的边框。 这是代码: Sproc Details:
我是一名优秀的程序员,十分优秀!