Home  >  Article  >  Web Front-end  >  用CSS给Asp.net控件定位_html/css_WEB-ITnose

用CSS给Asp.net控件定位_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:40:371278browse

css

用居中的代码给
元素定位没有问题,能居中,
给Asp.net的Label控件定位就不能实现了,求解
.title        {            margin:0px auto;            width:80%;            }

回复讨论(解决方案)

肯定是周围的元素 限制了 。可以 设置 border:1px solid red  看看 到底是怎么回事

debug一下看看服务器控件生成后的代码是什么样的
其次 注意元素的display默认属性 比如div默认是block 而label是inline等等

呵呵,搞明白了,想给label布局,开始直接对label用的样式,这样布局不起作用,直接在外面加了div,上面的布局就行了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn