RadioButtonList控件绑定图片Vertical对齐

数据源来自:http://www.cnblogs.com/insus/archive/2013/02/03/2890852.html 今天再去微软网站下载哪些图片时,发现windows的图标颜色变了。

现在的问题是,在这些图片绑定至RadioButtonList控件时,图片应该是Vertical对齐。
还是先来看看前一帖在浏览时,它的html源代码:



上图高亮部位的代码,就是每个选项产生的代码,有它有一个input标签,type为Radio,一个Label标签和Label标签内还有一个img标签组成。根据这些特征,我们在网页写一个样式style:

<style type="text/css">
        input[type="radio"], input[type="radio"] + label img {
            vertical-align: middle;
        }
    </style>


好的,我们再来浏览一次,不过在RadioButtonList添加两个属性,让其横排显示。

 RepeatColumns="5" RepeatDirection="Horizontal"


效果图:

 

posted @ 2013-05-28 08:59  Insus.NET  阅读(1230)  评论(0编辑  收藏  举报