CSS - width not honored on span tag

后端 未结 5 1502
青春惊慌失措
青春惊慌失措 2021-02-06 23:26

I have a issue with one of my spans. Please consider the following styles:

.form_container .col1che
{
float: left; 
width: 4%; 
text-align: left;    
}

.form_c         


        
5条回答
  •  日久生厌
    2021-02-06 23:49

    display: block will not help you here because when float is activated, the elements is automatically switched to block mode, whatever its initial mode, so your width should work.

    The problem may be with the empty tag which might not be rendered because of some obscure rule I cannot remember. You should try preventing your span from being empty, maybe by adding a   if the content is empty.

提交回复
热议问题