I want to create an A4 style page in HTML. However I want it to look the same whenever I zoom in and out. For example look at the following screenshots:
When I zoom out, the paragraph looks longer inside the page. What I want is a Word Style zoom in and out.
Here is the way this page is coded:
<div class="document">
<div class="page">
<div class="content">
<h1>Hello World</h1>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
</div>
</div>
CSS Code:
body {
margin: 0;
padding: 0;
background-color: grey;
}
.page{
margin:auto;
margin-top:50px;
width:210mm;
height:297mm;
background-color:white;
border:1px solid black;
padding:0px;
}
.content{
background-color: orange;
margin:10%;
}
The font-size-adjust property gives you better control of the font size when the first selected font is not available. When a font is not available, the browser uses the second specified font. This could result in a big change for the font size. To prevent this, use the font-size-adjust property.
You can use a <basefont> tag to set all of your text to the same size, face, and color. The font tag is having three attributes called size, color, and face to customize your fonts. To change any of the font attributes at any time within your webpage, simply use the <font> tag.
Output: Approach 4: Using separate CSS to select the required text and using the font-size property to change the font size. The size value can be set using length units or keywords like x-small, small or large.
To change the font size in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-size. HTML5 do not support the <font> tag, so the CSS style is used to add font size.
Webkit browsers (like Chrome or Opera) try to resize the text on low zoom (like 25%) to make it readable. If you look at the computed css you will notice that the font size is changing, even if you define it in your css. You would need a plugin, that disables this resizing.
100% zoom in chrome
25% zoom in chrome
Internet Explorer dont resizes the font-size on low zoom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With