当前位置:网站首页>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

边栏推荐
- ABAP-调用Restful API
- 求求你们,别再刷 Star 了!这跟“爱国”没关系!
- 三星率先投产3nm芯片,上海应届硕士生可直接落户,南开成立芯片科学中心,今日更多大新闻在此...
- 微服务追踪SQL(支持Isto管控下的gorm查询追踪)
- 《性能之巅第2版》阅读笔记(五)--file-system监测
- 【OpenCV 例程200篇】216. 绘制多段线和多边形
- 电脑照片尺寸如何调整成自己想要的
- Seata中1.5.1 是否支持mysql8?
- MySQL backup and restore single database and single table
- Programming examples of stm32f1 and stm32subeide - production melody of PWM driven buzzer
猜你喜欢

软件测试的可持续发展,必须要学会敲代码?

综述 | 激光与视觉融合SLAM

如何写出好代码 - 防御式编程指南

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

2022 Moonriver全球黑客松优胜项目名单

How to adjust the color of the computer screen and how to change the color of the computer screen

Photoshop插件-HDR(二)-脚本开发-PS插件

STM32F1与STM32CubeIDE编程实例-PWM驱动蜂鸣器生产旋律

ATSS:自动选择样本,消除Anchor based和Anchor free物体检测方法之间的差别

张驰课堂:六西格玛数据的几种类型与区别
随机推荐
搜索框和按钮缩放时会有缝隙的bug
ThinkPHP advanced
【一天学awk】条件与循环
Zhang Chi Consulting: household appliance enterprises use Six Sigma projects to reduce customers' unreasonable return cases
将ABAP On-Premises系统连接到中央检查系统以进行自定义代码迁移
Rhcsa fourth day operation
【LeetCode】43. 字符串相乘
Tensorflow team: we haven't been abandoned
求求你们,别再刷 Star 了!这跟“爱国”没关系!
【php毕业设计】基于php+mysql+apache的教材管理系统设计与实现(毕业论文+程序源码)——教材管理系统
最新NLP赛事实践总结!
AVL 平衡二叉搜索树
马来西亚《星报》:在WTO MC12 孙宇晨仍在坚持数字经济梦想
【开源数据】基于虚拟现实场景的跨模态(磁共振、脑磁图、眼动)人类空间记忆研究开源数据集
SAP S/4HANA: 一条代码线,许多种选择
Trace the source of drugs and tamp the safety dike
并发编程系列之什么是ForkJoin框架?
The newly born robot dog can walk by himself after rolling for an hour. The latest achievement of Wu Enda's eldest disciple
Deep operator overloading (2)
自動、智能、可視!深信服SSLO方案背後的八大設計