체크 상자 집합을 레이아웃하고 있는데 텍스트가 너무 길면 체크 상자 아래에 오래된 텍스트 줄 바꿈 문제가 있습니다.체크 박스 아래에 텍스트 줄 바꿈 방지
내 HTML :
<div class="right">
<form id="updateProfile">
<fieldset class="checkboxes">
<p>4. What is your favorite type of vacation?</p>
<label><input type="checkbox" name="vacation" value="Ski Trips"> Ski Trips</label>
<label><input type="checkbox" name="vacation" value="Beach Visits"> Beach Visits</label>
<label><input type="checkbox" name="vacation" value="Cruises"> Cruises</label>
<label><input type="checkbox" name="vacation" value="Historical and educational trips"> Historical and educational trips</label>
<label><input type="checkbox" name="vacation" value="Yachting"> Yachting</label>
<label><input type="checkbox" name="vacation" value="Road Trip"> Road Trip</label>
<label><input type="checkbox" name="vacation" value="Spa Weekend"> Spa Weekend</label>
<label><input type="checkbox" name="vacation" value="Bed and Breakfast"> Bed and Breakfast</label>
<label><input type="checkbox" name="vacation" value="Stay home and relax"> Stay home and relax</label>
<label><input type="checkbox" name="vacation" value="Gambling Trips"> Gambling Trips</label>
<label><input type="checkbox" name="vacation" value="Volunteer"> Volunteer</label>
</fieldset>
</form>
</div>
내 CSS :
div.right{width:580px;}
form#updateProfile fieldset label{
display: block;
margin-bottom: 5px;
font-size: 16px;
float: left;
width: 33%;
}
여기 내 바이올린 참조 : http://jsfiddle.net/fmpeyton/7WmGr/
많은 다른 사이트에서 검색 한 후, 나는 합리적인를 찾을 수 없습니다 해결책. 내 마크 업/스타일을 변경하는 것에 대한 제안이 열려 있지만 최대한 깨끗하고 의미있는 코드로 유지하려고합니다.
감사합니다.
18px 대신 왼쪽으로 마주 칠 필요가있었습니다. 이렇게하면 텍스트가 겹치지 않게됩니다. – ccStars