Reputation: 37
I have created a website where I had wanted the heading <h1>
adjust their size along with the width of the <header>
. I used the vw
property for this. But the property is not working in firefox as the font size being shown over there is very small.
You can see in this fiddle what I mean. If you run this fiddle in firefox, you will see the small sized fonts.
Body {
background: white;
font-family: "Myriad Pro";
size: 12px;
color: #323232;
}
header {
position: relative;
width: auto;
height: auto;
max-height: 239px;
min-height: inherit;
background: #d1d2d4;
overflow: hidden;
}
header h1 {
font-family: "Arial";
font-size-adjust: 0.10;
font-size: 5vw;
color: black;
position: absolute;
left: 13.5%;
top: 25%;
}
header p {
font-family: "Myriad Pro";
font-size-adjust: 0.10;
font-size: 2vw;
color: #404041;
position: absolute;
left: 13.5%;
top: 64%;
letter-spacing: 2pt;
}
<header>
<img src="images/Logo.png" style="margin-left:2.5%; margin-top:2.5%; width:10%; height:inherit;" />
<h1 style="">Website®</h1>
<p>Welcome To My Website!</p>
<img src="http://tinyurl.com/ku6cgpy" style="align: right; float:right; width:40%; height:auto; overflow-style:auto; overflow:visible;" />
</header>
Can someone tell me what am I doing wrong?
Upvotes: 0
Views: 170
Reputation: 20199
Remove font-size-adjust: 0.1
in header h1
Body {
background: white;
font-family: "Myriad Pro";
size: 12px;
color: #323232;
}
header {
position: relative;
width: auto;
height: auto;
max-height: 239px;
min-height: inherit;
background: #d1d2d4;
overflow: hidden;
}
header h1 {
font-family: "Arial";
font-size: 5vw;
color: black;
position: absolute;
left: 13.5%;
top: 25%;
}
header p {
font-family: "Myriad Pro";
font-size-adjust: 0.10;
font-size: 2vw;
color: #404041;
position: absolute;
left: 13.5%;
top: 64%;
letter-spacing: 2pt;
}
<header>
<img src="images/Logo.png" style="margin-left:2.5%; margin-top:2.5%; width:10%; height:inherit;" />
<h1 style="">Website®</h1>
<p>Welcome To My Website!</p>
<img src="http://tinyurl.com/ku6cgpy" style="align: right; float:right; width:40%; height:auto; overflow-style:auto; overflow:visible;" />
</header>
Upvotes: 0