开发者

Problem when trying to hide a column using HTML/CSS

I need to hide a column as well as other elements when my page is printed, and in order to do that I have a print style sheet, everything works fine, except for the column I want to make disappear, the strange thing is that my stylesheet works in IE, but it didn't in Mozilla and Chrome; why's that?

HTML code

   <col width="10%" class="art-editcolumn"/>

and here's the CSS class:

.art-editcolumn
{

   display: none;

}

Hope you can help me out wi开发者_如何学JAVAth this.


The display CSS property is not allowed for the col tag. Only background, width and borders. So the standards based browsers are simply ignoring it.


See the following entry for the <col> tag: http://www.w3schools.com/TAGS/tag_col.asp

You will note that only ONE attribute is supported in Firefox: 'width'

Also from that reference, the only CSS styles you can apply are 'background', 'width' and 'border':

Add the style attribute to the <col> tag, and let CSS take care of backgrounds, width and borders. These are the ONLY CSS properties that work with the <col> tag.

Hope that helps :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜