我可以给ON和OFF按钮大小固定长度吗? [英] Can I give fixed length for ON and OFF buttons size?

查看:71
本文介绍了我可以给ON和OFF按钮大小固定长度吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面有两个ON和OFF按钮html代码,基于我在屏幕上显示状态的条件(我有每个LED的多行),当有些显示ON而有些显示OFF时我的行移位,因为ON按钮是小于OFF(ON是2个字符,OFF是3个字符),无论如何我可以指定两者都应该采用固定长度吗?


< input type = ”按钮" value =" ON&qu​​ot; style =" background-color:#00cc00;颜色:#ffffff;" />


< input type =" button"值= QUOT; OFF" style =" background-color:#cc0000;颜色:#ffffff;" />

I have these two ON and OFF buttons html code below, based on condition I am displaying status on screen(I have mutliple lines for each LED), my row shifting when some displaying ON and some displaying OFF, because ON button is smaller than OFF (ON is 2 character and OFF is 3 character), Is there anyway I can specify for both should take fixed length?.


<input type="button" value="ON " style="background-color: #00cc00; color: #ffffff;" />

<input type="button" value="OFF" style="background-color: #cc0000; color: #ffffff;" />

推荐答案

嘿。


您可以指定CSS width int样式属性。
Hey.

You could specify the CSS width int he style attribute.
展开 | 选择 | Wrap | 行号


谢谢。我的宽度为40px,现在我有两个按钮大小相同,但是当我做一些ON和一些OFF时,我仍然可以看到一些对齐问题,当我全部打开或关闭时,那么它是完美的,但当它打开时和OFF,我可以看到一些对齐问题。可能我需要把它们全部放在一个盒子里我相信。我可以在这里发布那个HTML代码吗?有些html专家可以帮我修复一致吗?看起来我缺少一些简单的技术观点。提前谢谢
Thanks. I made width as 40px, now I have both buttons equal size, but when I do some ON and some OFF, still I can see some alignment issue, when I make all ON or OFF, then it is perfect, but when it is ON and OFF, I can see some alignment issue. May be I need to keep all of them in one box I believe. Can I post that html code here?, can some html expert help me to fix alignment?. Looklike some simple technical point I am missing. thanks in advance


当然。发布您的HTML示例 - 请在[code]标签中 - 或者只是指向实际网页的链接,我们会看一下。
Sure. Post an example of your HTML - within [code] tags please -, or just a link to a live page, and we will take a look at it.


这篇关于我可以给ON和OFF按钮大小固定长度吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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