Bramblethorn
Sleep-deprived
- Joined
- Feb 16, 2012
- Posts
- 18,001
Every so often we get questions here asking "how do I control the font for my Literotica story?" and the usual answer is "you can't, apart from bold and italics".
But my new story for the "AI Era" event includes a lot of email and chat logs, and I wanted a way to distinguish them from the rest of the text. So I looked at the options, and what do you know? It's possible to do this in a Literotica story, if you're willing to insert the HTML tags yourself:
The trick is using the <kbd> tag. Here's what I submitted to generate the above, as pasted into the story text box:
It's not strictly required to close out and reopen the <kbd> tags with every line break. I did this to avoid trouble just in case a Literotica page break fell in the middle of one of these sections.
My beta readers caught a couple of spots where I'd messed up my tags, and after fixing those I previewed carefully to make sure there weren't any more. Then I submitted, with a note to the moderator mentioning that I was using these tags and to let me know if there were any problems. Apparently there weren't.
I'm not entirely decided whether I like the look, but if you want the option, it's there.
Strictly speaking, <kbd> isn't setting a specific font. Rather, it tells the reader's browser: "this next bit represents keyboard input, so please format it however your user likes that kind of content to be formatted". This usually defaults to a monospaced font as shown in the screenshot above, but some users/browsers will have their own ways of rendering it. For technical wonks, googling on "semantic vs. non-semantic HTML tags" should find you some explanation on why it's best to do it this way instead of trying to dictate a specific font.
But my new story for the "AI Era" event includes a lot of email and chat logs, and I wanted a way to distinguish them from the rest of the text. So I looked at the options, and what do you know? It's possible to do this in a Literotica story, if you're willing to insert the HTML tags yourself:
The trick is using the <kbd> tag. Here's what I submitted to generate the above, as pasted into the story text box:
After that I went back inside, poured myself a glass of Merlot, and sat down at my keyboard to type. (It's an old-lady thing; when you've been typing as long as I have, it feels wrong not to have the click-clack of keys pushing back against one's fingers.)
<Kbd>> Hello cabbage, I’m home.</kbd>
<kbd>> Darling, I missed you. How was it?</kbd>
<kbd>> Not bad, as funerals go. There were some lovely tributes, and I think you would have liked the flowers. I left Toby with you. Emilie gave a beautiful speech, I’ll get you a transcript tomorrow.</kbd>
It's not strictly required to close out and reopen the <kbd> tags with every line break. I did this to avoid trouble just in case a Literotica page break fell in the middle of one of these sections.
My beta readers caught a couple of spots where I'd messed up my tags, and after fixing those I previewed carefully to make sure there weren't any more. Then I submitted, with a note to the moderator mentioning that I was using these tags and to let me know if there were any problems. Apparently there weren't.
I'm not entirely decided whether I like the look, but if you want the option, it's there.
Strictly speaking, <kbd> isn't setting a specific font. Rather, it tells the reader's browser: "this next bit represents keyboard input, so please format it however your user likes that kind of content to be formatted". This usually defaults to a monospaced font as shown in the screenshot above, but some users/browsers will have their own ways of rendering it. For technical wonks, googling on "semantic vs. non-semantic HTML tags" should find you some explanation on why it's best to do it this way instead of trying to dictate a specific font.