简体   繁体   English

移动响应上的 CSS 宽度问题

[英]CSS width issue on mobile responsive

Wondering why the 2 pages, About and Contact have different width when it comes to the text.想知道为什么 2 页,关于和联系在文本方面有不同的宽度。

They are both using the same style but one is narrow and one is wider.它们都使用相同的样式,但一种窄,一种宽。 Mainly noticed this on the mobile version especially and its driving me crazy.主要是在移动版本上注意到这一点,这让我发疯。

https://genesisventuresinvestments.com/about.html https://genesisventuresinvestments.com/about.html

https://genesisventuresinvestments.com/contact.html https://genesisventuresinvestments.com/contact.html

.dummy-dummy-text{
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  padding: 0 20px;
  transform: translate(-50%, -50%);
}

由于某种原因,这很窄 这个更宽

I used word-break: break-word and works fine, however I'd recommend using clamp() to edit the font size as a best practice, here are some suggestions我使用word-break: break-word并且工作正常,但是我建议使用clamp() 来编辑字体大小作为最佳实践,这里有一些建议

h1 {
font-size: clamp(1.913rem, calc( 12px + 2.475vw ), 2.587rem);
line-height: 1.1;
}


h2 {
font-size: clamp(1.575rem, calc( 12px + 1.800vw ), 2.025rem);
line-height: 1.1;
}


h3 {
font-size: clamp(1.282rem, calc( 12px + 1.350vw ), 1.688rem);
line-height: 1.1;
}


h4 {
font-size: clamp(1.125rem, calc( 12px + 0.900vw ), 1.350rem);
line-height: 1.1;
}


p {
font-size: clamp(1.035rem, calc( 12px + 0.540vw ), 1.125rem);
line-height: 1.1;
}


span {
font-size: clamp(0.900rem, calc( 12px + 0.360vw ), 1.012rem);
line-height: 1.1;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM