更新DIV高度 [英] Update DIV height

查看:82
本文介绍了更新DIV高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我有一个带有类的fav.css文件.favBg

hello,

I have a fav.css file with class .favBg

展开 | 选择 | Wrap | 行号

推荐答案

嗨...


据我所知,不幸的是你不能设定css的高度 - class,但您可以通过以下方式设置文档节点的高度:

hi ...

as far as i know, unfortunatly you can''t set the height of the css-class but you can set the height of a document node the following way:

展开 | 选择 | Wrap | 行号


...等一下;)...我已经尝试了一些能够完成工作的东西......看看下面的例子:


[HTML]

< html>


< style id =" style_sheet" type =" text / css">

.test {

颜色:绿色;

}

< / style>


< body>


< h1 id =" test_head"> TEST-HEADER< / h1>


< script>

document.getElementById(''test_head'')。className =''test'' ;


alert(document.getElementById(''style_sheet'')。inner HTML);


var new_class =''。test { color:};'';


document.getElementById(''style_sheet'')。innerHTML = new_class;

< / script>


< / body>

< / html>

[/ HTML]


......真的很丑;但也许它有效吗? ......我永远不会为我做那件事;))


亲切的问候......
... and wait a moment ;) ... i have tried something that does the job ... have a look at the following example:

[HTML]
<html>

<style id="style_sheet" type="text/css">
.test {
color: green;
}
</style>

<body>

<h1 id="test_head"> TEST-HEADER </h1>

<script>
document.getElementById(''test_head'').className = ''test'';

alert(document.getElementById(''style_sheet'').inner HTML);

var new_class = ''.test {color: red;}'';

document.getElementById(''style_sheet'').innerHTML = new_class;
</script>

</body>
</html>
[/HTML]

... really ugly ;) but perhaps it works? ... and i would never do that for me ;))

kind regards ...



嗨...


据我所知,不幸的是你不能设置css类的高度但你可以设置文档节点的高度通过以下方式:

hi ...

as far as i know, unfortunatly you can''t set the height of the css-class but you can set the height of a document node the following way:

展开 | 选择 | Wrap | 行号


这篇关于更新DIV高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆