html – 选择字体大小

html – 选择字体大小,第1张

概述我已经建立了 this fiddle作为我正在做的一个例子。 我想做的工作在Firefox中工作正常。当您打开选择选项时,font-size为14px。 然而,在Google Chrome浏览器中,它会选择继承的字体大小为34px。 我最理想的是选择要选择的字体大小为14px。 这可以做吗 如果需要,我愿意在jQuery中做任何相关的修复。 谢谢 下列代码…… 我的CSS是: .styled-se 我已经建立了 this fiddle作为我正在做的一个例子。

我想做的工作在firefox中工作正常。当您打开选择选项时,Font-size为14px。

然而,在Google Chrome浏览器中,它会选择继承的字体大小为34px。

我最理想的是选择要选择的字体大小为14px。

这可以做吗

如果需要,我愿意在jquery中做任何相关的修复。

谢谢

下列代码……

我的CSS是:

.styled-select {    overflow: hIDden;    height: 74px;    float: left;    wIDth: 365px;    margin-right: 10px;    background: url(http://i50.tinypic.com/9ldb8j.png) no-repeat right center #5c5c5c;}.styled-select select {    Font-size: 34px;    border-radius: 0;    border: none;    background: transparent;    wIDth: 380px;    overflow: hIDden;    padding-top: 15px;    height: 70px;    text-indent: 10px;    color: #ffffff;    -webkit-appearance: none;}.styled-select option.service-small {    Font-size: 14px;    padding: 5px;    background: #5c5c5c;}

HTML标记:

<div >    <select  name="service-area">        <option selected="selected" >Service area?</option>        <option >Volunteering</option>        <option >Partnership &amp; Support</option>        <option >Business Services</option>    </select></div>
解决方法 一个解决方案可能是在 optgroup中包装选项:

HTML:

<optgroup>  <option selected="selected" >Service area?</option>  <option >Volunteering</option>  <option >Partnership &amp; Support</option>  <option >Business Services</option></optgroup>

CSS:

optgroup { Font-size:14px; }
总结

以上是内存溢出为你收集整理的html – 选择字体大小全部内容,希望文章能够帮你解决html – 选择字体大小所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1114744.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存