【问题标题】:Radio button new line text in virtuemart美德玛特中的单选按钮换行文本
【发布时间】:2018-02-04 14:22:07
【问题描述】:

我是编码新手,我使用的是最新版本的 joomla。我在使用 drugmart 的自定义字段中的单选按钮时遇到问题。在 Firefox 中,单选按钮如下所示:

但在 chrome 中它们看起来不同。每行有一个收音机,然后是文本,然后是收音机。

我希望它看起来像这样:

此外,这在标签名称较长时效果很好,但在标签名称较短时效果不佳。

 .radio, .checkbox {
        padding-left: 18px;
    }
    label {
        color: #333333;
        margin-bottom: 5px;
        max-width: 90%;
    }

label, input, button, select, textarea {
    font-weight: normal;
    display: inline;
}
input[type="radio"], input[type="checkbox"] {
    display: block;
    margin-right: 10px;
    border: none;
}
layout.css:252
input[type="image"], input[type="checkbox"], input[type="radio"] {
    border-radius: 0;
    cursor: pointer;
    height: auto;
    line-height: normal;
    margin: 3px 0;
    padding: 0;
    width: auto;
}
layout.css:247
label input, label textarea, label select {
    display: block;
}
layout.css:294
input, textarea {
    -moz-transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
}
layout.css:231
input, textarea, select, #advanced-search-toggle, input.search-query {
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 9px;
    padding: 4px;
}
layout.css:220
label, input, button, select, textarea {
    font-weight: normal;
    display: inline;
}
user agent stylesheet
input[type="radio" i] {
    margin: 3px 3px 0px 5px;
}
user agent stylesheet
input[type="radio" i] {
    -webkit-appearance: radio;
    box-sizing: border-box;
}
user agent stylesheet
input[type="radio" i], input[type="checkbox" i] {
    background-color: initial;
    margin: 3px 0.5ex;
    padding: initial;
    border: initial;
}
user agent stylesheet
input {
    -webkit-appearance: textfield;
    background-color: white;
    -webkit-rtl-ordering: logical;
    user-select: text;
    cursor: auto;
    padding: 1px;
    border-width: 2px;
    border-style: inset;
    border-color: initial;
    border-image: initial;
}
user agent stylesheet
input, textarea, select, button {
    text-rendering: auto;
    color: initial;
    letter-spacing: normal;
    word-spacing: normal;
    text-transform: none;
    text-indent: 0px;
    text-shadow: none;
    display: inline-block;
    text-align: start;
    margin: 0em;
    font: 13.3333px Arial;
}
user agent stylesheet
input, textarea, select, button, meter, progress {
    -webkit-writing-mode: horizontal-tb;
}

我在这里尝试了许多建议,但每当进行更改时,都会出现问题。 Firefox 和 chrome 之间的不兼容也令人沮丧。

【问题讨论】:

    标签: css button radio


    【解决方案1】:

    您可以将单选按钮包裹在另一个标签中并使其显示为块状,这样项目就会被堆叠。

    HTML

    <div><input type="radio" name="gender" value="male" checked> Male</div>
    <div><input type="radio" name="gender" value="female"> Female</div>
    <div><input type="radio" name="gender" value="other"> Other</div>
    

    使用 div 你不需要 display: block 属性

    【讨论】:

    • @ace 这有帮助吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多