如何在 HTML 中设置按钮的大小 [英] How to set the size of button in HTML

查看:32
本文介绍了如何在 HTML 中设置按钮的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的纯 HTML/JS 页面上有一些按钮.在浏览器中打开页面时,按钮大小是正常的.但是在刷新/重新加载页面上,按钮大小会减小.其实我还没有设置按钮的文本值.按钮的文本是空白的.无论文本大小如何,我应该如何在 HTML 中设置按钮的大小?

I have some buttons on my pure HTML/JS page. When the page is opened in browser, the button size is normal. But on refresh/reloading page, the button size is reduced. In fact, I have not set the button text value. The button's text is blank. How should I set the size of my button in HTML irrespective to the size of the text?

推荐答案

你的意思是像这个吗?

HTML

<button class="test"></button>

CSS

.test{
    height:200px;
    width:200px;
}

如果您想使用内联 CSS 而不是外部样式表,请参阅this:

If you want to use inline CSS instead of an external stylesheet, see this:

<button style="height:200px;width:200px"></button>

这篇关于如何在 HTML 中设置按钮的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆