【发布时间】:2013-04-26 11:47:10
【问题描述】:
有人知道为什么<legend> 标签不在 JQuery mobile 中居中吗?例如我尝试了以下代码。
<fieldset data-role="controlgroup" data-type="horizontal" data-theme="a">
<legend>I would this site.<legend>
<input type="radio" name="radio-choice-2-6" id="radio-choice-1-6" value="choice-1-6" />
<label for="radio-choice-1-6">1</label>
<input type="radio" name="radio-choice-2-6" id="radio-choice-2-6" value="choice-2-6" />
<label for="radio-choice-2-6">2</label>
<input type="radio" name="radio-choice-2-6" id="radio-choice-3-6" value="choice-3-6" />
<label for="radio-choice-3-6">3</label>
<input type="radio" name="radio-choice-2-6" id="radio-choice-4-6" value="choice-4-6" />
<label for="radio-choice-4-6">4</label>
<input type="radio" name="radio-choice-2-6" id="radio-choice-5-6" value="choice-5-6" />
<label for="radio-choice-5-6">5</label>
</fieldset>
当我在移动设备和模拟器上检查时,<legend> 标记保持文本左对齐,即使我为 <legend> 标记应用了样式 text-align: center。但是,如果我输入更长的文本,那么它可以正常工作。例如:
<fieldset data-role="controlgroup" data-type="horizontal" data-theme="a">
<legend><p>If given the choice, I would rather spend time with my family than with friends or working.</p><legend>
<input type="radio" name="radio-choice-2-8" id="radio-choice-1-8" value="choice-1-8" />
<label for="radio-choice-1-8">1</label>
<input type="radio" name="radio-choice-2-8" id="radio-choice-2-8" value="choice-2-8" />
<label for="radio-choice-2-8">2</label>
<input type="radio" name="radio-choice-2-8" id="radio-choice-3-8" value="choice-3-8" />
<label for="radio-choice-3-8">3</label>
<input type="radio" name="radio-choice-2-8" id="radio-choice-4-8" value="choice-4-8" />
<label for="radio-choice-4-8">4</label>
<input type="radio" name="radio-choice-2-8" id="radio-choice-5-8" value="choice-5-8" />
<label for="radio-choice-5-8">5</label>
</fieldset>
有人可以大声回答吗?
【问题讨论】:
-
您是否尝试过明确地制作
legenddisplay:block,并且它没有浮动?fieldset标签也是如此
标签: css html jquery-mobile jquery-mobile-fieldset