简体   繁体   English

IE 中的 CSS 文本框渲染问题

[英]Issue with CSS Text box rendering in IE

I have been trying to build a search engine using basic HTML and CSS for my Uni but IE just doesnt seem to like text boxes.我一直在尝试使用基本的 HTML 和 CSS 为我的 Uni 构建一个搜索引擎,但 IE 似乎不喜欢文本框。 Works perfectly fine in Chrome and Edge but for some reason doesnt work well in IE.在 Chrome 和 Edge 中运行良好,但由于某种原因在 IE 中运行不佳。

Screenshots attached below.下面附上截图。 Image in IE Image in Chrome IE 中的图像 Chrome中的图像

Any help would be highly appreciated.任何帮助将不胜感激。

Code for the search box and the search text button:搜索框和搜索文本按钮的代码:

 .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>

你能在 .search-box 类中设置 400px 吗?

Try to add the height property for the .search-text, code as below:尝试为 .search-text 添加高度属性,代码如下:

    .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;
    } 

The output as below:输出如下:

在此处输入图片说明

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

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