当前位置:网站首页>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
边栏推荐
- 【云动向】6月上云新风向!云商店热榜揭晓
- 【开源数据】基于虚拟现实场景的跨模态(磁共振、脑磁图、眼动)人类空间记忆研究开源数据集
- 【一天学awk】函数与自定义函数
- ThinkPHP kernel work order system source code commercial open source version multi user + multi customer service + SMS + email notification
- 智慧党建: 穿越时空的信仰 | 7·1 献礼
- ABAP-屏幕切换时,刷新上一个屏幕
- 关于用 ABAP 代码手动触发 SAP CRM organization Model 自动决定的研究
- [stm32-usb-msc problem help] stm32f411ceu6 (Weact) +w25q64+usb-msc flash uses SPI2 to read out only 520kb
- 摩根大通期货开户安全吗?摩根大通期货公司开户方法是什么?
- 【显存优化】深度学习显存优化方法
猜你喜欢
【显存优化】深度学习显存优化方法
电脑屏幕变色了怎么调回来,电脑屏幕颜色怎么改
超视频时代,什么样的技术会成为底座?
Win11如何設置用戶權限?Win11設置用戶權限的方法
精益六西格玛项目辅导咨询:集中辅导和点对点辅导两种方式
你TM到底几点下班?!!!
Don't ask me again why MySQL hasn't left the index? For these reasons, I'll tell you all
Pico,是要拯救还是带偏消费级VR?
Smart Party Building: faith through time and space | 7.1 dedication
Comment win11 définit - il les permissions de l'utilisateur? Win11 comment définir les permissions de l'utilisateur
随机推荐
Crypto Daily:孙宇晨在MC12上倡议用数字化技术解决全球问题
Task. Run(), Task. Factory. Analysis of behavior inconsistency between startnew() and new task()
Automatique, intelligent, visuel! Forte conviction des huit conceptions derrière la solution sslo
开机时小键盘灯不亮的解决方案
[STM32 learning] w25qxx automatic judgment capacity detection based on STM32 USB storage device
Summer Challenge harmonyos canvas realize clock
最新NLP赛事实践总结!
Research on manually triggering automatic decision of SAP CRM organization model with ABAP code
《性能之巅第2版》阅读笔记(五)--file-system监测
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
【OpenCV 例程200篇】216. 绘制多段线和多边形
Description | Huawei cloud store "commodity recommendation list"
有些能力,是工作中学不来的,看看这篇超过90%同行
新出生的机器狗,打滚1小时后自己掌握走路,吴恩达开山大弟子最新成果
Day 3 of rhcsa study
[stm32-usb-msc problem help] stm32f411ceu6 (Weact) +w25q64+usb-msc flash uses SPI2 to read out only 520kb
Task.Run(), Task.Factory.StartNew() 和 New Task() 的行为不一致分析
picgo快捷键 绝了这人和我的想法 一模一样
[open source data] open source data set for cross modal (MRI, Meg, eye movement) human spatial memory research based on virtual reality scenes
大龄测试/开发程序员该何去何从?是否会被时代抛弃?