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

边栏推荐
- STM32F1与STM32CubeIDE编程实例-PWM驱动蜂鸣器生产旋律
- 【LeetCode】43. String multiplication
- 2023届春招实习-个人面试过程和面经分享
- [one day learning awk] conditions and cycles
- 张驰课堂:六西格玛数据的几种类型与区别
- Task.Run(), Task.Factory.StartNew() 和 New Task() 的行为不一致分析
- Introduction to RT thread env tool (learning notes)
- How to adjust the color of the computer screen and how to change the color of the computer screen
- 嵌入式开发:5个修订控制最佳实践
- AVL balanced binary search tree
猜你喜欢

Tensorflow team: we haven't been abandoned

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

基于PHP的轻量企业销售管理系统

你TM到底几点下班?!!!

HR interview: the most common interview questions and technical answers

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

有些能力,是工作中学不来的,看看这篇超过90%同行

新出生的机器狗,打滚1小时后自己掌握走路,吴恩达开山大弟子最新成果

Automatique, intelligent, visuel! Forte conviction des huit conceptions derrière la solution sslo

Automatic, intelligent and visual! Deeply convinced of the eight designs behind sslo scheme
随机推荐
如何写出好代码 - 防御式编程指南
【LeetCode】43. String multiplication
Rhcsa fourth day operation
MySQL advanced 4
Advanced cross platform application development (24): uni app realizes file download and saving
药品溯源夯实安全大堤
Win11如何设置用户权限?Win11设置用户权限的方法
【Pygame实战】你说神奇不神奇?吃豆人+切水果结合出一款你没玩过的新游戏!(附源码)
Logical analysis of automatic decision of SAP CRM organization model
张驰咨询:家电企业用六西格玛项目减少客户非合理退货案例
The newly born robot dog can walk by himself after rolling for an hour. The latest achievement of Wu Enda's eldest disciple
Introduction to RT thread env tool (learning notes)
Pnas: brain and behavior changes of social anxiety patients with empathic embarrassment
超视频时代,什么样的技术会成为底座?
[200 opencv routines] 216 Draw polylines and polygons
【开源数据】基于虚拟现实场景的跨模态(磁共振、脑磁图、眼动)人类空间记忆研究开源数据集
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(三)
摩根大通期货开户安全吗?摩根大通期货公司开户方法是什么?
Zhang Chi's class: several types and differences of Six Sigma data
Go语学习笔记 - gorm使用 - 表增删改查 | Web框架Gin(八)