The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> A Couple of CSS Questions For Displaying ASCII Art
sgtscott
post 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?

IPB Image

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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 9th May 2024 - 01:42 AM