首页 > 解决方案 > 响应按钮角

问题描述

我正在开发一个 angular 8 的应用程序,我有一个带有不同按钮的表单。我想知道是否有任何方法可以使 Chrome 和 Firefox 手机显示的按钮响应。这是我现在拥有的:

在此处输入图像描述

我的代码:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">

<div class="row justify-content-around">
  <button (click)="register()" class="btn btn-outline-primary col-4"> Submiiiiiiiiit </button>
  <button type="submit" class="btn btn-primary col-4"> Validate </button>
</div>

第一个按钮的显示是向下的,但第二个按钮是好的,我猜是文字造成了不同。

谢谢你。

标签: htmlcssangulartwitter-bootstrap

解决方案


使用vw字体单位,对应于视口宽度的 1%。

这是一个代码示例:

.btn {
    font-size: 5vw;
}

和功能示例在这里


推荐阅读