gpt4 book ai didi

c# - Blazor 单击图像按钮后,图像有边框

转载 作者:行者123 更新时间:2023-12-04 10:38:08 24 4
gpt4 key购买 nike

我正在为我的 Blazor Nuget 包之一构建示例元素,但遇到了一个通常只在 Windows 窗体类型元素中看到的问题。

单击箭头按钮后,该按钮具有边框:

enter image description here

在 Windows 窗体世界中,我会将焦点设置在屏幕外的文本框或控件上。

如果点击后有一个 CSS 设置,也许这​​可以解决问题,或者如果有人知道从按钮上清除焦点的方法?

我的按钮只是一个简单的按钮:

<button class="nextbutton" @onclick="NextButton_Click"></button>

以及 nextbutton 的 css:
.nextbutton 
{
display: inline-block;
border: none;
width: 52px;
height: 64px;
background-image: url('../images/buttons/bluearrowright.png');
background-color: transparent;
transform: scale(0.75);
transform-origin: left;
}

提前致谢,如果有 CSS 技巧,或者一种将焦点设置在屏幕外的方法,如果你向我展示 JavaScript,我会同意的。

最佳答案

这是我的答案的来源。我已经在这里投票了。

How to remove focus around buttons on click

.nextbutton:focus 
{
outline: none;
}

我在发帖之前确实搜索过,但是我在等待答案时搜索了更多内容并找到了上面的帖子。工作完美。

关于c# - Blazor 单击图像按钮后,图像有边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60067629/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com