带 div 块且不带 ?
我并不是说使用 调整大小,尽管它的外观与我的目标相同。我想要此处中的僵尸狗代码但对于任意大小的图像。请阅读我的代码中的注释。
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="" />
<Content type="html">
<![CDATA[
// This won't change the size of the image but the size of div.
<style type="text/css">
#zombiecontainer{
height:100%;
width:100%;
}
</style>
// I want to specify the size of the image with Div -block relative to the size
// of iGoogle gadget.
<div id="zombiecontainer"
style="text-align:center;" width="100%" height="100%">
</div>
<script type="text/javascript">
var images = new Array();
images[0] = _IG_GetImage("https://pictures/friends.jpg");
// How can I do it with the div? I don't want to create a static picture
// and put the code to the div block. I want to be able to change it,
// hopefully, with below commands. No more messy HTML.
_gel("zombiecontainer").innerHTML = "";
_gel("zombiecontainer").appendChild(images[0]);
</script>
</div>
]]>
</Content>
</Module>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不太确定我理解你的问题,但这行得通吗?
这会将 Zombiecontainer div 中任何图像的高度和宽度设置为您定义的任何值(在本例中为 div 的 50%)。
Not quite sure I understand your question, but will this work?
This will set the height and width of any image in the zombiecontainer div to whatever values you define (in this case 50% of the div).
我将解决 Piontek Media 未解决的一个小问题。如果您希望图像像示例中那样居中,则需要以下内容,因为它不能位于图像块内。
如果您可以更简洁地做到这一点,请告诉我。
I will address a minor issue that Piontek Media did not address. If you want the image is centered like in the example, you need the below because it cannot be inside the image block.
If you can do it more succinctly, please, let me know.