当前位置:网站首页>There will be a gap bug when the search box and button are zoomed
There will be a gap bug when the search box and button are zoomed
2022-07-01 15:55:00 【Xiaozai's Guyu】
Problem description :
Make a similar Baidu's search box , browser 100% No problem , But zoom to 175% Time button and input There will be gaps .
100% design sketch

175% design sketch

Pictured above : It is obvious that There are gaps
The reason for this is : When retracted to 175% when , should 1.75 Lattice representative 1 Pixels , However, due to the limitation of hardware level , For example, a grid is drawn with four physical pixels ,0.25 The grid does not draw , so 1.75 Lattice 0.75, Only three squares can be used to draw , An unpainted grid creates a gap (css The page scaling border produces gap Correlation )
If it is Button and input There is a gap between them And not aligned You can refer to :input Input box and button Determine the default spacing between buttons
The code is as follows :
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<div class="search">
<input type="search" name="" id="" placeholder=" Search for " />
<button> Search for </button>
</div>
<style type="text/css">
.search {
position: absolute;
top: 25px;
left: 346px;
width: 534px;
height: 32px;
border: 2px solid #b1191a;
}
.search input {
float: left;
padding-left: 10px;
width: 454px;
height: 32px;
vertical-align: middle;
border: none;
outline: none;
}
.search button {
float: left;
width: 80px;
height: 32px;
background-color: #b1191a;
color: #f8f7f7;
border: none;
}
</style>
</body>
</html>Solution :
1. You can give button Add one more outline:1px solid xxx ;
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<div class="search">
<input type="search" name="" id="" placeholder=" Search for " />
<button> Search for </button>
</div>
<style type="text/css">
.search {
position: absolute;
top: 25px;
left: 346px;
width: 534px;
height: 32px;
border: 2px solid #b1191a;
}
.search input {
float: left;
padding-left: 10px;
width: 454px;
height: 32px;
vertical-align: middle;
border: none;
outline: none;
}
.search button {
float: left;
width: 80px;
height: 32px;
background-color: #b1191a;
color: #f8f7f7;
border: none;
outline: solid 1px #b1191a;
}
</style>
</body>
</html>100% design sketch :

175% design sketch

边栏推荐
- HR interview: the most common interview questions and technical answers
- 如何写出好代码 - 防御式编程指南
- Logical analysis of automatic decision of SAP CRM organization model
- 【IDM】IDM下载器安装
- Go language learning notes - Gorm use - table addition, deletion, modification and query | web framework gin (VIII)
- Day 3 of rhcsa study
- SAP CRM organization Model(组织架构模型)自动决定的逻辑分析
- 分享在大疆DJI(深圳总部)工作的日常和福利
- Don't ask me again why MySQL hasn't left the index? For these reasons, I'll tell you all
- 【OpenCV 例程200篇】216. 绘制多段线和多边形
猜你喜欢

马来西亚《星报》:在WTO MC12 孙宇晨仍在坚持数字经济梦想

Please, stop painting star! This has nothing to do with patriotism!

RT-Thread Env 工具介绍(学习笔记)

【Pygame实战】你说神奇不神奇?吃豆人+切水果结合出一款你没玩过的新游戏!(附源码)

AVL 平衡二叉搜索树
![[pyGame practice] do you think it's magical? Pac Man + cutting fruit combine to create a new game you haven't played! (source code attached)](/img/0a/c1a4b57b9729e0cf9de1feae9f8c19.png)
[pyGame practice] do you think it's magical? Pac Man + cutting fruit combine to create a new game you haven't played! (source code attached)

How to adjust the size of computer photos to what you want

精益六西格玛项目辅导咨询:集中辅导和点对点辅导两种方式

Pico,是要拯救还是带偏消费级VR?

Factory high-precision positioning management system, digital safety production management
随机推荐
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
Pico, can we save consumer VR?
电脑屏幕变色了怎么调回来,电脑屏幕颜色怎么改
2022 Moonriver全球黑客松优胜项目名单
Zhang Chi Consulting: household appliance enterprises use Six Sigma projects to reduce customers' unreasonable return cases
[pyGame practice] do you think it's magical? Pac Man + cutting fruit combine to create a new game you haven't played! (source code attached)
使用 csv 导入的方式在 SAP S/4HANA 里创建 employee 数据
Trace the source of drugs and tamp the safety dike
Redis秒杀demo
求求你们,别再刷 Star 了!这跟“爱国”没关系!
【IDM】IDM下载器安装
Pocket network supports moonbeam and Moonriver RPC layers
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(三)
picgo快捷键 绝了这人和我的想法 一模一样
【OpenCV 例程200篇】216. 绘制多段线和多边形
Pnas: brain and behavior changes of social anxiety patients with empathic embarrassment
Introduction to RT thread env tool (learning notes)
三星率先投产3nm芯片,上海应届硕士生可直接落户,南开成立芯片科学中心,今日更多大新闻在此...
vscode 查找 替换 一个文件夹下所有文件的数据
[video memory optimization] deep learning video memory optimization method