Forcing label to flow inline with input that they label

前端 未结 7 1206
时光取名叫无心
时光取名叫无心 2020-12-13 17:55

I need the label to stay on the same line as the input field they are labeling. I want these elements to flow like they normally would when the window resizes, i just want t

相关标签:
7条回答
  • 2020-12-13 18:38

    http://jsfiddle.net/jwB2Y/123/

    The following CSS class force the label text to flow inline and get clipped if its length is more than max-length of the label.

    .inline-label { 
        white-space: nowrap;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        float:left;     
        }
    

    HTML:

    <div>
        <label for="id1" class="inline-label">This is the dummy text i want to display::</label>
        <input type="text" id="id1"/>
    </div>
    
    0 讨论(0)
提交回复
热议问题