I cannot get my heading to behave how I want to responsively.
When I'm resizing my window, it looks just how I want it to look. However, when I go into dev tools device mode, the view of the iPhone for instance ends up with the text all in line even though I have the span set to display: block, and, the heading is way higher than I desire. For other devices, the heading is bleeding outside of the div.
What I want is this, which is how it looks when I resize my browser window accordingly. It is not anywhere near what I get in device mode.
I made a pen with all of my code.
I really have tried all night and it's discouraging that I have not found a solution. A major issue I have in addition to this, is I'd love to find a way to do this without the VH units for the position of the header, because as you will see in the pen, when the window is less then 900px high, the header bleeds outside of the div. Any help would be greatly appreciated!
<div class="container">
<h1>**** On <span>Tour</span></h1>
</div>
@import url(http://fonts.googleapis.com/css?family=Raleway:900,600,500,800,700);
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Raleway', sans-serif;
background-color: white;
}
.container {
background: url('http://i.imgur.com/W6DHyPf.jpg') no-repeat center center;
-webkit-background-size: cover;
-o-background-size: cover;
background-size: cover;
overflow-x: hidden;
overflow-y: auto;
height: 40vh;
width: 100%;
}
h1 {
position: absolute;
top: 22vh;
color: #ff1744;
mix-blend-mode: exclusion;
font-weight: 900;
font-size: 5em;
letter-spacing: -3px;
padding: 0 .2em;
text-align: justify;
margin: 0 auto;
text-transform: uppercase;
}
@media screen and (min-width: 375px) {
h1 {
top: 24vh;
}
span {
display: block;
}
}
@media screen and (min-width: 562px) {
h1 {
font-size: 6em;
top: 20vh;
}
}
@media screen and (min-width: 681px) {
h1 {
font-size: 7em;
top: 17vh;
}
span {
display: inline;
}
}
@media screen and (min-width: 729px) {
h1 {
font-size: 7em;
top: 28vh;
}
@media screen and (min-width: 729px) {
h1 {
font-size: 7em;
top: 28vh;
}
@media screen and (min-width: 2560px) {
h1 {
font-size: 10em;
top: 28vh;
}
}