gpt4 book ai didi

html - 一侧 Angular 响应式标题

转载 作者:太空宇宙 更新时间:2023-11-04 10:26:16 26 4
gpt4 key购买 nike

当浏览器在伪元素溢出并导致问题后调整绝对定位大小时。我正在寻找解决此问题的方法。只需调整浏览器大小,直到出现标题文本。

wide header test text

这是问题的演示:http://codepen.io/anon/pen/grKNoJ

.section {
font-family: 'Quantico';
font-weight: bold;
font-size: 36px;
color: white;
border-top: solid 1px black;
text-transform: uppercase;
margin-bottom: 28px;
}

.section-title {
background-color: black;
display: inline-block;
padding: 8px 18px;
position: relative;
}
.section-title:after {
content: " ";
position: absolute;
display: block;
right: 0;
height: 100%;
top: 0;
left: 0;
z-index: -1;
background: #000;
transform-origin: bottom left;
-ms-transform: skew(-30deg, 0deg);
-webkit-transform: skew(-30deg, 0deg);
transform: skew(-30deg, 0deg);
}

最佳答案

您可以通过将 text-overflow: ellipsis;white-space: nowrap; 添加到 .section-title 来修复它。

您还可以为该元素设置一个max-width,并根据您的媒体查询将其设置为不同的值,并使其在不同的设备上满足您的需求。

这是更新后的结果:http://codepen.io/johnnykb/pen/mPKZLg

关于html - 一侧 Angular 响应式标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36763743/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com