如何调整Col-MD Bootstrap中的字体尺寸ORD字体对齐

发布于 2025-02-06 19:42:42 字数 876 浏览 2 评论 0原文

我是初学者,但通常我以某种方式找到解决问题的方法。但不是这次。 我设法编码一个框:以框中为中心,上面有“#01 grunderna”。这个盒子看起来不错。

#01 GRUNDERNA

但是,当盒子中间的文本更长的时间为“#02 profil& scensamlingar”,则文本正在覆盖框。此外,文本不是垂直居中的。

#02 PROFIL & SCENSAMLING

有没有办法可以调整这一点?我尝试使用字体大小,但仍在覆盖盒子,它仍未调整到中间,线之间的空间相同。

对不起,我缺乏知识。获得一些帮助会很棒。

顺便说一句:在这里您可以看到Mess

在此处输入图像描述

I am a beginner but usually I somehow find a solution to my problem. But not this time.
I managed to code a box: Centered in the box there is the text "#01 Grunderna". This box looks nice.

#01 GRUNDERNA

However, when the text in the middle of the box is longer like "#02 Profil & Scensamlingar" then the text is overwrapping the box. Moreover, the text is not centered vertically.

#02 PROFIL & SCENSAMLING

Is there a way to be able to adjust this? I tried with font-size but it is still overwrapping the box, it is still not adjusted to the middle and the space between the lines stands the same.

Sorry for my lack of knowledge. Would be awesome to get some help.

By the way: Here you can see the mess

enter image description here

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

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

发布评论

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

评论(2

爱的故事 2025-02-13 19:42:42

.Home-Service a中删除CSS规则填充:1REM 1REM;。并添加下面的CSS规则:

.home-service {
  display: flex;
  align-items: center;
  justify-content: center;
}

这些框中的链接将在垂直和水平上是合理的。

如果您使用的是Bootstrap,则可以使用其提供的类。选中此页面: https://getbootstrap.com/docs/5.0/flex/flex/flex/ < /a>尤其是“证明内容”和“对齐项目”部分。如果您想更深入地了解CSS中的Flex的工作原理,请检查此链接 https://css-tricks.com/snippets/css/a-guide-to-flexbox/ 然后添加书签以备将来使用:)

Remove the css rule padding: 1rem 1rem; from .home-service a. And add below css rule:

.home-service {
  display: flex;
  align-items: center;
  justify-content: center;
}

Links in those boxes will be justified vertically and horizontally.

If you are using bootstrap, you may make use of the classes it provides. Check this page: https://getbootstrap.com/docs/5.0/utilities/flex/ especially "Justify content" and "Align items" sections. If you want to dig deeper about how flex in css works, check this link https://css-tricks.com/snippets/css/a-guide-to-flexbox/ then bookmark it for future use:)

任谁 2025-02-13 19:42:42

非常感谢您解决我的问题。就像魔术:)您应该看到我的微笑!

无论如何,我在“自定义主题”部分中将其添加为其他CSS,因为我在主题编辑器中尚未找到它。
我想最好按照主题编辑中提到的更改或无关紧要?

Thank you so very much for solving my problem. It is like magic :) You should see my smile!

Anyway, I added it as additional css in the customize theme section as I did not find it in the theme editor yet.
I guess it is better to do the changes exactly as you mentioned in the theme-editor or does it not matter?

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