RadioButtonList控件绑定图片Vertical对齐

来源:互联网 发布:数控铣床卡通图案编程 编辑:程序博客网 时间:2024/05/16 11:51

数据源来自: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"


效果图:

 


<script type="text/javascript"><!--google_ad_client = "ca-pub-1944176156128447";/* cnblogs 首页横幅 */google_ad_slot = "5419468456";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>