简体   繁体   English

H1标签无反应

[英]H1 Tag not responsive

I have the H1 tag set but its not responsive. 我设置了H1标签,但没有响应。 I have the code as follows which I thought should work but obviously not. 我有以下代码,我认为应该可以,但显然不行。

<div class="middle">
        <h1>Cheryl Cox Counselling</h1></div>



body {
font-size: 100%;
}


.middle {
display: flex;
width: 55%;
justify-content: center;
}




h1 {
font-family: 'Great Vibes', cursive;
font-size: 7em;
padding-top: .5em;
color: grey;
text-shadow: -1px -1px 0px rgba(255, 255, 255, 0.3), 1px 1px 0px 
rgba(0, 0, 0, 0.8);
}

The below should be responsive. 下面应该有所作为。 You were using a very big font-size and hence it was not breaking the word. 您使用的是非常大的字体,因此并没有打断单词。 The code below will break the word but in order to make the font-size responsive, you will have to use media queries at your breakpoints. 下面的代码会打断单词,但是为了使字体大小敏感,您必须在断点处使用媒体查询。

https://jsfiddle.net/71dfq220/2/ https://jsfiddle.net/71dfq220/2/

<div class="middle">
  <h1>Cheryl Cox Counselling</h1>
</div>


body {
font-size: 100%;
}


.middle{
  width:100%;
  position:relative;
}

h1 {
font-family: 'Great Vibes', cursive;
font-size: 5em;
white-space:normal;
word-break: break-all;
color: grey;
text-shadow: -1px -1px 0px rgba(255, 255, 255, 0.3), 1px 1px 0px 
rgba(0, 0, 0, 0.8);
text-align:center;
width:100%;
}

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

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