- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将图像向右浮动。这应该很简单。它在 FF 和 Chrome 中看起来不错,但在 IE 中,文本不会环绕图像。我认为这与我赋予段落标签的样式有关。无论如何,我们将不胜感激!
风格:
.story {
margin: 0 0 0 360px;
padding-top: 30px;
padding-left: 30px;
max-width: 900px;
width: 75%;
}
.story p {
line-height: 150%;
font-size: 20px;
}
.half-embed {
float: right;
position:relative;
margin-right:-100px;
margin-left:20px;
display: inline !important;
clear:both;
}
.imageborder {
border: 1px solid lightgray;
padding: 10px;
}
html:
<div class="story">
<p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.</p>
<p>Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.</p>
<p><img src="images/myimage.jpg" class="half-embed imageborder" /></p>
<p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.</p>
<p>Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.</p>
</div>
最佳答案
您正在 float 图像,它位于 display: inline-block
中元素(默认)== <p>
所以 <p>
占据视口(viewport)的整个宽度,即使您的图像是 float 的。所以你的文字不能环绕你的图像(使用此处提供的 hTML),因为你的文字在其他 <p>
中。的:
<p>Now ....</p>
<p><img src="images/myimage.jpg" class="half-embed imageborder" /></p>
<p>...</p>
要让文字环绕图像,您应该这样做:
<p>
<img src="images/myimage.jpg" class="half-embed imageborder" alt="">
Now we are engage......//oper that we
</p>
.half-embed {
float: right;
margin: 0 0 20px 20px;
display: block;
}
关于css - 向右浮动在 IE 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20103800/
有没有人知道那里有预览@page CSS 规则的工具?如果做不到这一点,有什么东西可以用来打印完全支持这些规则的文档吗? http://www.w3.org/TR/CSS2/page.html 歌剧最
出于某种原因,当我向我的元素添加右/左浮动时,它会在下一行的图像元素后面显示它们。 这是实际的事件页面: http://www.dealerbyte.co.uk/used-cars.php 代码如下:
我想知道是否可以使用下面的 onTouch 方法来检测用户是否在屏幕上向左、向右、向上或向下移动手指。我有一个包含对象的网格,我只希望用户能够在四个方向上移动其中一个对象。 我的想法是使用 Actio
我想获取div的鼠标坐标,如下所示: $("#box").mousemove(function(e){ var x = e.pageX - this.offsetLeft; var y = e.pag
到目前为止,我有一个可以左右前后移动的玩家,但是我如何设置它是向前的,就像在网格上一样向前,而不是在我的玩家注视的地方向前。我将相机设置为 FPS,它跟随玩家。现在我想让玩家能够使用我的 MouseL
在水平时间轴 slider jquery 中,我希望默认情况下它是右向的。就像现在的图片,2015 年的价格就在右边。我希望默认选择最右边的 2017 年价格,用户可以向左滚动 我的代码 $('.ti
我正在尝试为纸牌游戏(Yu-Gi-Oh :D)制作一个牌组管理器,目前我只有一个包含可用纸牌的表格和一个面板,该面板以更大的尺寸显示用户选择的纸牌以及纸牌的描述。MVCE: import ja
我有一个从简单手势扩展的类,我正在使用 onfling 方法: class MyGestureListener extends GestureDetector.SimpleOnGestureListe
我很懒惰,讨厌每 5 秒就必须将右手移到箭头键或鼠标上来移动光标和编辑文本。有什么方法可以让我的手保持在打字位置并四处移动光标? 最佳答案 您可以在特定的首选项窗口中更改这些设置: windows -
这是我的第一个应用程序,我尝试进行从右到左或从左到右的翻译。 这是代码 Res > anim > translate_left Res > anim > translate_right
我有以下代码: out of bound :( 我不希望它穿过 window 。我需要它的右边框保持可见。 JSFiddle 链接:http://jsfiddle.net/9SZAB/ 最佳答案
我正在尝试让我的导航图标菜单按钮在 THIS IS A LOGO Home About
因为我自己的代码有问题,所以我正在研究以下链接: https://bost.ocks.org/mike/path/ 我想我已经低于 // push a new data point onto the
所以首先这就是我要实现的目标 我想保持 Logo 在网页中间居中,搜索栏向右拉(下面有文字)这是我目前拥有的代码: http://jsfiddle.net/62b4jf1n/
这个问题在这里已经有了答案: Android: How to handle right to left swipe gestures (22 个回答) 关闭4个月前。 我有一个 Android 应用程
我正在尝试创建一个控件,用户可以在该控件中触摸并移动框架内的按钮。这是我的代码。 - (void)wasDragged:(UIButton *)button withEvent:(UIEvent *)
我正在使用svg创建一个几何campass工具,其中有3个btns,1) 用于移动位于中心的整个营地2) 增加圆的半径3)用于旋转圆的半径4)根据第4个btn的位置使用路径(svg)绘制圆,该位置始终
无论分辨率如何,我都试图将此框移到屏幕的右侧,但我找不到答案。 我的代码是这样的 wp_get_archives( array( 'type' => 'postbypost',
我正在为 Qt 按钮小部件编写弹出菜单。每当单击按钮时,都会弹出一个菜单(在按钮下方)。 弹出菜单默认位于下方左侧。 有没有办法让弹出菜单在按钮下方的右侧弹出? 没有设置位置功能,所以我想知道是否有一
我正在尝试使用 jQuery 构建一个扫雷游戏,我成功地使用 event.which 处理了左右点击,但是是否可以同时检测到左右按钮的点击? 最佳答案 我怀疑你是否会同时获得两者,一次会先出现,即使相
我是一名优秀的程序员,十分优秀!