Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

HTML <pre> tag contents resizing on android

I am currently working on a client-side HTML website, and I would like to add an ASCII-based logo at the top of my page. I am embedding this logo in <pre> tags to preserve whitespace, and it works as expected on desktop browsers. Also resizing in a desktop browser does not throw up any problems.

But when I access my website from an actual smartphone, the whitespace size seems to change and as a result, the ASCII-logo becomes unreadable. Pictures and actual code attached below.

View on desktop: View on desktop

View on Samsung S8:
View on Samsung S8

#boot-logo{
    margin: 0!important;
    width: 100vw!important;
    font-family: monospace!important;
    color: black!important;
    font-size: 1rem!important;
}
<pre id="boot-logo">
██╗    ██╗██╗███╗   ██╗██████╗  ██████╗ ██╗    ██╗███████╗             
██║    ██║██║████╗  ██║██╔══██╗██╔═══██╗██║    ██║██╔════╝             
██║ █╗ ██║██║██╔██╗ ██║██║  ██║██║   ██║██║ █╗ ██║███████╗             
██║███╗██║██║██║╚██╗██║██║  ██║██║   ██║██║███╗██║╚════██║             
╚███╔███╔╝██║██║ ╚████║██████╔╝╚██████╔╝╚███╔███╔╝███████║             
╚══╝╚══╝ ╚═╝╚═╝  ╚═══╝╚═════╝  ╚═════╝  ╚══╝╚══╝ ╚══════╝             
██████╗ ███████╗████████╗██████╗  ██████╗     ██╗   ██╗ ██╗    ██████╗ 
██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗    ██║   ██║███║   ██╔═████╗
██████╔╝█████╗     ██║   ██████╔╝██║   ██║    ██║   ██║╚██║   ██║██╔██║
██╔══██╗██╔══╝     ██║   ██╔══██╗██║   ██║    ╚██╗ ██╔╝ ██║   ████╔╝██║
██║  ██║███████╗   ██║   ██║  ██║╚██████╔╝     ╚████╔╝  ██║██╗╚██████╔╝
╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝ ╚═════╝       ╚═══╝   ╚═╝╚═╝ ╚═════╝ 
</pre>
question from:https://stackoverflow.com/questions/65907934/html-pre-tag-contents-resizing-on-android

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...