4Manuals

  • PDF Cloud HOME

IE中CSS文本框渲染的问题 Download

    具有Iframe表单的HTML文件,使用框架外的按钮通过JQuery提交表单按钮 CSS / JS-如何覆盖一个孩子而不是其他孩子的父母过渡 反应:更改方向后触发重新渲染和offsetWidth的重新计算 我的Javascript从'string'转换为'integer'或'number'无效 CSS在像素中设置多个颜色渐变? 创建一个没有固定布局的HTML表,设置最大宽度,并且行不换行但溢出:隐藏 如何删除外部索引并合并内部json 在React Native 图片无法通过javascript刷新 如何在react图表上的datakey中操作DateTime

我一直在尝试使用适用于Uni的基本HTML和CSS构建搜索引擎,但IE似乎并不喜欢文本框。在Chrome和Edge中可以正常工作,但是由于某些原因在IE中无法很好地工作。

以下是屏幕截图。 Image in IE Image in Chrome

任何帮助将不胜感激。

搜索框和搜索文本按钮的代码:

.search-box {
    position: absolute;
    top: 260px;
    left: 46%;

    transform: translate(-50%, -50%);
    background: #2f3640;
    height: 60px;
    border-radius: 40px;
    padding: 10px;
}

.search-box:hover > .search-text {
    width: 350px;
    padding: 0 6px;

}

.search-box:hover > .search-btn {
    background: white;

}

.search-btn {
    color: #e84118;
    float: right;
    width: 40px;
    height: 40px;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    background: #2f3640;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 1s;

}

.search-text {
    font-family: VFRegular;
    border: 1px red solid;
    background: none;
    outline: none;
    float: left;
    padding: 0;
    color: white;
    font-size: 16px;
    -webkit-transition: 0.5s;
    -moz-transition: 0.5s;
    transition: 0.5s;
    line-height: 40px;
    width: 0px;


}

/*
.search-box:hover ~ .category-box {
    width: 400px;
    opacity: 1;
    visibility: visible;


}


.category-box:hover {
    width: 400px;
    opacity: 1;
    visibility: visible;
}

.category-box {
    position: absolute;
    align-items: center;
    top: 38%;
    left: 50%;
    text-decoration-color: white;
    transform: translate(-50%, -50%);
    background: #2f3640;
    height: 60px;
    border-radius: 40px;
    padding: 10px;
    width: 0px;
    color: white;
    visibility: collapse;
    opacity: 0;
    transition: width 1s, height 1s, transform 1s;
    transition: opacity 1s;

}
*/

.search-box > ul {
    left: -100px;
    background-color: #2f3640;
    color: white;
    border-radius: 10px;
    list-style-type: none;
    font-size: 15px;


}

.search-box > ul li {
    left: -10px;
    margin: 0 0 10px 0;
    border-bottom: 1px solid white;
    z-index: 1;
}

.search-box > ul li:last-child {
    margin: 0 0 10px 0;
    border-bottom: 1px solid transparent;
}

.search-box > ul li:hover {
    color: red;
}
<div class="entire-searchbox">
    <div class="search-box">
        <input class="search-text" type="text" placeholder="Type to search">

        <a class="search-btn" href="#">
            <i class="fas fa-search"></i>
        </a>

        <ul id="testListDummy">
        </ul>
    </div>
</div>

2 个答案:

答案 0 :(得分:0)

尝试为.search-text添加height属性,代码如下:

    .search-text {
        font-family: VFRegular;
        border: 1px red solid;
        background: none;
        outline: none;
        float: left;
        padding: 0;
        color: white;
        font-size: 16px;
        -webkit-transition: 0.5s;
        -moz-transition: 0.5s;
        transition: 0.5s;
        line-height: 40px;
        width: 0px;
        height:58px;
    } 

输出如下:

enter image description here

答案 1 :(得分:0)

您可以在.search-box类中设置400px正常吗



Similar searches
    在laravel的yield部分中传递图像 如何在预编译的Kotlin脚本中禁用Jacoco中的xml / csv报告 Samsung RS2531 Refrigerator User Manual 如何使用R从pdf文件中提取数据 如何过滤Mautic中的表单提交?