JQuery Mobile:切换栏中标签的中心文本对齐

发布于 2024-12-12 12:04:13 字数 255 浏览 7 评论 0原文

我创建了这个简单的代码,它只是一个按钮,单击时保持“推送”状态,再次单击时恢复正常。

问题: 通过使用 float:right 标签中的文本会向右移动,如果我不设置浮动,默认情况下它会向左移动。但是当我放置 float:center 时,它会保留在左侧。如果有人可以帮助我将文字放在中心,我会很高兴。谢谢你!

这是我来自 jsfiddle 的代码

I created this simple code, It it just a button that stays on a "push" state when clicked and returns to normal when clicked again.

THE PROBLEM:
by using float:right the text in the label goes to right, and if i dont set the float it goes to the left by default. but when I put float:center it stays on the left. If someone can help me put the text on the center I would be happy. thank you!

This is my code from jsfiddle

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天生の放荡 2024-12-19 12:04:13

您想要居中的 jQuery Mobile 元素是使用 .ui-btn-text 类嵌套在字段集中的元素:

#ui-2 .ui-btn-text {
    text-align : center;
    width      : 100%;
}

http://jsfiddle.net/nfGmJ/10/

The jQuery Mobile element you want to center is the one nested within your fieldset with the .ui-btn-text class:

#ui-2 .ui-btn-text {
    text-align : center;
    width      : 100%;
}

http://jsfiddle.net/nfGmJ/10/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文