[英]Aligning text horizontally within a grid box
I'm trying to align horizontally the h4 tag "some other head" within my grid, as you can see right now they are not aligned.我正在尝试水平对齐网格中的 h4 标签“其他头”,正如您现在可以看到的那样,它们没有对齐。 Is there a way to do this within the grid box?有没有办法在网格框中做到这一点? Thanks!谢谢!
Here is my example of code:这是我的代码示例:
Current Code:
https://codepen.io/kjay125/pen/GRpQgbj
You can do it in two ways:
1. If your text is static then add a fix height for p tag. Add this css:
p {
height: 220px;
display:block;
}
2. But if it can be changed or by internationalization, it can get converted to different language and gets longer/shorter than you have to set the height of p through javascript/JS after the page is loaded. But the crux is, you have to set a fixed height of `<p>`.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.