使用 div float &保证金属性
我正在尝试将广告放入我的博文中我希望我的数据环绕广告。我正在使用以下代码来实现这一点。
前任。所需的输出。
.
<div style='float:right;margin:50px 0px 0px 0px;'>
<!-- AD1 Code -->
</div>
<data:post.body/>
<div style='float:left;margin:0px 0px 50px 0px;'>
<!-- AD2 Code -->
</div>
但我无法将文本环绕在它周围&第二个 div 粘在底部,右侧不显示任何数据。 除了 Float
和 margin
之外,是否还有任何属性需要添加。
编辑:
是获取每个博主帖子内容的标签。所以帖子的数据会自动出现。必须将此代码添加到模板中,以便它适用于每个帖子。我无法在每个帖子中对 Div 标签进行硬编码,因此我需要一些方法来在我的帖子周围排列广告。
我可以将具有指定属性的 div
放在
标记的开头或结尾。
谢谢。
I am trying put ads inside my blogger post & i want my data to wrap around the ads.I am using following code to make this happen.
Ex. Desired output.
.
<div style='float:right;margin:50px 0px 0px 0px;'>
<!-- AD1 Code -->
</div>
<data:post.body/>
<div style='float:left;margin:0px 0px 50px 0px;'>
<!-- AD2 Code -->
</div>
But i am not able to wrap the text around it & Second div sticks to the bottom without showing any data on the right side.
Is there any property which is left to be added apart from Float
and margin
.
EDIT: <data:post.body/>
is the tag which fetches every blogger post content. so the data for the post come automatically. This code has to be added in the template so that it works for every post. I can't hard code the Div tags inside every post so i need some method to arrange ads around my post.
I can put the div
s with the specified properties at the starting or ending of the <data:post.body/>
tag.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试以下操作:
预览:http://jsfiddle.net/Gs2kD/
You can try this :
Preview : http://jsfiddle.net/Gs2kD/
您可以使用 JavaScript 将广告放入帖子中,例如使用 jQuery 特别容易。
您唯一需要弄清楚的是如何为广告找到合适的位置,即在代码中实际插入广告的位置。
You can put the ads inside the post with JavaScript, especially easy with jQuery for example.
The only thing you have to figure out, is how to find a good location for you ads, i.e. where to actually insert them in the code.
“clear”属性可以防止任何浮动元素与其所在元素处于相同的 Y 位置在。
查看 Sandbag Float Pusher 以及 css-lab.com。它在同一侧使用一个薄的虚拟浮动器将“广告”向下推到您想要的位置。 “广告”已设置为“清除”。此技术允许您根据需要在不进行修改的情况下流入内容。
谷歌搜索
css sandbag
了解更多技术。The "clear" attribute can prevent any floaters at the same Y position as the element that it's on.
Check out Sandbag Float Pusher, and the other sandbags on css-lab.com. It uses a thin dummy floater on the same side to push the "ad" down to where you want it. The "ad" has "clear" set. This technique allows you to flow the content in without modification, as you require.
Google for
css sandbag
for more techniques.