A Couple of CSS Questions For Displaying ASCII Art |
A Couple of CSS Questions For Displaying ASCII Art |
sgtscott |
Dec 4 2023, 09:03 AM
Post
#1
|
Group: Members Posts: 6 Joined: 4-December 23 Member No.: 29,094 |
Can I remove this gap at the top of the page?
I have tried margin: 0; padding: 0; border: 0; outline: 0; and more but nothing I do seems to be able to get rid of it. It is there in Chrome, Edge and Brave. and also, I wrote a VB.Net program that lets you load any small image and then converts that image to ASCII art as HTML. I currently write the HTML as (for example): CODE <html> <head> <body bgcolor = "#000000"> <pre><font face = "Courier New" size ="1"> <font color = "#660099">F</font><font color = "#660066">v</font><font color = "#660066">v</font>... and then end the file with: ...<font color = "#002B00">:</font><font color = "#660066">v</font><font color = "#660099">F</font> </pre> </body> </html> It simply copies the color image loaded and makes a grayscale copy and then based on that value, picks an ASCII character (I have 92 characters all weighted from darkest to lightest) mapped to a gray shade value 0 to 255. Then with the original color image I take the RGB and convert it to <font color = "#RRGGBB>&#ASC Value</font>. and this works well EXCEPT Courier New is slightly taller that it is wide so my ASCII art looks a bit stretched. I could change my code to "squash" the image before rendering the HTML, but I wondered if instead there was a CSS statement that could make Courier New (or any fixed width font) to have a 1 to 1 aspect ratio when displayed? Thank you |
Lo-Fi Version | Time is now: 19th June 2024 - 07:41 PM |