简体   繁体   English

单选按钮不会以html形式显示

[英]Radio button won't display in html form

I am new to html and css. 我是html和CSS的新手。 I plan to create a signup form by html and css. 我计划通过html和css创建一个注册表单。 However, the radio button is not displayed when I run the html file in browser. 但是,当我在浏览器中运行html文件时,单选按钮未显示。 I have no idea which part is going wrong. 我不知道哪一部分出了问题。 Please help! 请帮忙! Here is my html file, 这是我的html文件,

<!DOCTYPE html>
<html>
<style>
    input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
</style>
<head>
    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="msapplication-tap-highlight" content="no" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="css/ionic.min.css" />
    <title>Create an Account</title>
</head>
<body>
    <div class="bar bar-header">
        <h1 class="title">Create an Account</h1>
        <a href="login.html" class="button button-clear button-royal">Login</a>
    </div>
    <div class="padding" style="margin-top:75px;">
        <label class="item-input">
            <span class="input-label">Full Name</span>
            <input type="text" placeholder="" id="fullname">
        </label>
        <label class="item-input">
            <span class="input-label">Username</span>
            <input type="text" placeholder="" id="username">
        </label>
        <label class="item-input">
            <span class="input-label">Email</span>
            <input type="email" placeholder="" id="email">
        </label>
        <label class="item-input">
            <span class="input-label">Password</span>
            <input type="password" placeholder="" id="password">
        </label>
        <label class="item-input">
            <span class="input-label">Contact</span>
            <input type="number" placeholder="" id="contact">
        </label>
        <label class="item-input">
            <span class="input-label">Gender</span>
            <p>
                <input name="gender" type="radio" id="male" value="male" />
                <label for="male">Male</label>
                <input name="gender" type="radio" id="female" value="female" />
                <label for="female">Female</label>
            </p>
        </label>
        <label class="item-input">
            <button class="button button-block button-positive" id="signup">Create an Account</button>
        </label>


    </div>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/jq.js"></script>
    <script type="text/javascript" src="js/auth.js"></script>
</body>

</html> 

The css file is ionic.min.css. css文件是ionic.min.css。 This is the radio button part in the css file. 这是css文件中的单选按钮部分。

.item-input input {
    -webkit-border-radius: 0;
    border-radius: 0;
    -webkit-box-flex: 1;
    -webkit-flex: 1 220px;
    -moz-box-flex: 1;
    -moz-flex: 1 220px;
    -ms-flex: 1 220px;
    flex: 1 220px;
    -webkit-appearance: normal;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    padding-right: 24px;
    background-color: transparent
}
.item-radio .item-content {
    position: relative;
    z-index: 2;
    padding: 16px 49px 16px 16px;
    border: none;
    background-color: #fff
}

input[type=radio],
input[type=checkbox] {
    margin: 0;
    line-height: normal
}

.item-input input[type=radio],

input[type=radio][disabled],
input[type=radio][readonly],
input[type=checkbox][disabled],
input[type=checkbox][readonly] {
    background-color: transparent
}

.item-radio {
    padding: 0
}

.item-radio:hover {
    cursor: pointer
}

.item-radio .item-content {
    padding-right: 64px
}

.item-radio .radio-icon {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    visibility: hidden;
    padding: 14px;
    height: 100%;
    font-size: 24px
}

.item-radio input {
    position: absolute;
    left: -9999px
}

.item-radio input:checked~.item-content {
    background: #f7f7f7
}

.item-radio input:checked~.radio-icon {
    visibility: visible
}

.platform-android.grade-b .item-radio,
.platform-android.grade-c .item-radio {
    -webkit-animation: androidCheckedbugfix infinite 1s
}

如果可见单选按钮,则尝试将CS​​S Inline放入样式标签中,而不是在您的情况下加载CSS文件问题

change the -webkit-appearance: none; 更改-webkit-appearance:无; in css file to -webkit-appearance: normal; 在css文件中-webkit-appearance:正常; for item-input input. 用于项目输入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM