1
我创建在JavaScript中的一些元素,像这样:在ie6中appendChild()后,样式表是否适用于该元素?
var parent = document.createElement('div');
parent.setAttribute('id', 'parent');
var child = document.createElement('div');
child.setAttribute('class', 'child');
parent.appendChild(child);
otherelement.appendChild(parent);
我有这对于#parent
和.child
风格样式表。但是,似乎风格正在适用于父母,但不适用于孩子。 ie6只支持ID和不是类的样式,还是我做错了什么?