English 中文(简体)
如何使投入成为一条不受限制的玉米线
原标题:how to make a non-rouded corner line bottom of input bar

I m make fluent style input bar and this is my progress

但是,我希望其行程不会四舍五入,而当着重点时,它会改变其高度(改变布局)。

我怎么办?

这是我的法典。

body {
  background-color: #1a2228;
}

input {
  background: #272f36;
  border: 1px solid #282d31;
  border-radius: 3px;
  width: 10em;
  line-height: 1.5em;
  outline: none;
  color: white;
  border-bottom: 1px solid #979a9e;
  padding-left: 5px;
  transition: 200ms;
}

input::placeholder {
  color: #aeaeae;
  transition: 200ms;
}

input:hover {
  transition: 200ms;
  background: #2d343b;
}

input:focus {
  background: #1d1f21;
  transition: 200ms;
  border-bottom: 2px #4cc2ff solid;
}

input:focus::placeholder {
  color: #959697;
}

input[type="number"]::-webkit-inner-spin-button {
  cursor: pointer;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
<input id="a" type="number" min="0" max="100" placeholder="test">

no rounded corner bottom, like microsoft fluent design

问题回答

body {
  background-color: #1a2228;
}

input {
  box-sizing: border-box;
  background: #272f36;
  border-radius: 3px;
  line-height: 1.5em;
  border: 1px solid #484d31;
  outline: none;
  color: white;
  border-bottom: 1px solid #979a9e;
  width: 100%;
}

input:focus {
  border-bottom-color: transparent;
}

.myinput {
  width: 10em;
}

.myinput:has(input:focus) {
  border-bottom: 1px solid #4cc2ff;
}
<div class="myinput">
  <input>
</div>




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签