2

This may seem like a simple question, but how do I put a box of scrollable code or preformatted text in my question or comment on AskUbuntu?

It would be great if this question and the answer could be found in the help center.

  • You mean line an <iframe>? Something that would open up as embedded in the page content from a different site? (You can't, with iFrames, and the only type of embedding that I know works is images) – Thomas Ward Oct 16 '16 at 4:25
  • If it's an iframe, you don't. – muru Oct 16 '16 at 4:28
  • I don't think that's what I mean... I mean these grey scrolling boxes that have info from folks' Terminals in them, like in this question: askubuntu.com/questions/792858/… Are those called Embedded Frames? – jenboi Oct 16 '16 at 4:38
  • @jenboi No, that's just code formatting. The site, when provided with multiple lines indented by four spaces, automatically encircles the code block in a scrollable block. Read up on How do I format my posts using Markdown or HTML? on the Help Center for details on how to achieve different types of formatting. – Thomas Ward Oct 16 '16 at 4:44
  • Help section does have a page for formatting. Have a look askubuntu.com/help/formatting – Anwar Oct 16 '16 at 15:40
  • It is in the help center: formatting tools. If you post more code, it will scroll automatically. – terdon Oct 16 '16 at 18:51
5

Originally you asked about "Embedded Frames", which implies HTML iframe tags. Those don't work and are disabled for a reason - you can embed almost anything inside those from external sites, and that causes a TON of security risks.

In comments, you referred to this question as an example of what you're looking for. Basically, what that scrolling block of text is is just a very large block of code-formatted text. The posting system will automatically put long blocks of code-formatted (indented) text into a scrollable box in answers and questions so a single post doesn't take up a huge length of the page.

This only works in questions and answers. You can do preformatted text in comments by surrounding single lines of text within backticks (`), like this:

`This is preformatted text.` becomes This is preformatted text.

More on formatting is available in the help center.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .