pre Questions

20

Possible ways: <pre> ... </pre> or style="white-space:pre" Anything else?
Medwin asked 20/3, 2012 at 18:35

2

Solved

If I wanted to print code on an HTML page, but I want the <pre> block to be centered, but the actual text to be left aligned, how is this done? Just to make it simple, what would it take to ...
Balkan asked 18/11, 2015 at 21:0

5

Solved

Are there any libraries that will allow me to display code in <pre> tags and highlight the syntax according to the language? I'm imagining something like this: <pre class="python"> cla...
Duplicate asked 9/5, 2012 at 17:2

3

Solved

I have a simple webpage that takes query items and crafts them in to the page. Example URL: http://quir.li/player.html?media=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0VqTwnAuHws The page then ...
Towrope asked 4/1, 2013 at 13:38

8

Solved

I'd like to display raw HTML. We all know one has to escape each "<" and ">" like this: <PRE> this is a test &ltDIV&gt </PRE> However, I do not want ...
Ryley asked 28/5, 2013 at 4:9

11

I'm trying to display my code on a website but I'm having problems preserving the whitespace indentation correctly. For instance given the following snippet: <html> <body> Here is m...
Gybe asked 8/1, 2011 at 0:48

3

Solved

I'm using pre element to display some text including special unicode characters (⚡ ⚑ ▶ ◀ ⁋). I noticed that browsers render these special characters wider than regular ones, occupying more space ho...
Hanker asked 19/2, 2012 at 18:1

1

Solved

I have a code block in a Pandoc markdown file designated as: ```python for x in range(10): print('id is', x) ``` When I use the command pandoc example.md -s -o example.html I get the followin...
Mcripley asked 13/3, 2017 at 21:17

9

pre{font-family:cursive;font-style:italic;font-size:xxx-small} How to change pre font size?
Mundane asked 28/3, 2010 at 5:16

4

Solved

Per the examples https://getbootstrap.com/docs/4.3/content/code/#code-blocks, bootstrap only supports vertically-scrollable and word-wrapped <pre> blocks out of the box. How do I make it so t...
Insulting asked 29/4, 2012 at 17:18

2

Solved

I'm working on a website that has some code and I would like to write: <pre><code> line 1 line 2 </code></pre> But that produces an empty line at the beginning like this ...
Topside asked 1/2, 2018 at 18:1

2

Solved

I have scoured the possible answers and none of them work. All the innerHTML and PRE tag examples are fine with code or text, but NOT with HTML. Here is EXACTLY what I want to put into a variable: ...
Perak asked 24/10, 2017 at 12:46

3

Solved

I have a problem with the text-align "justify" inside a paragraph with format and fixed width, because I want the paragraph text in HTML to appear totally justified (like it would happen with a MS ...
Audacious asked 19/1, 2012 at 1:2

3

Solved

In my website documentation, I have some code that should be displayed like to suggest the user how they can change the look and feel of the website by following the displayed code. I don't want to...
Usurp asked 3/8, 2017 at 7:9

1

Solved

I am using HTML's <pre></pre> to render my text as is with \n and spaces in a block. But bootstrap's default behaviour puts a <pre> block in a bordered box with a grey background....
Adit asked 16/3, 2016 at 11:32

1

Solved

I use bootstrap and i have to use <pre> tag in my code but Bootstrap styling it and i don't like it. I know that i have to override it but i don't what exactly attributes i must change in suc...
Syllable asked 9/3, 2016 at 15:51

8

Solved

I simply want to create something like that: <strong>blah blah</strong> I've been trying to do this for a long time though for some reason whenever I put the code and the pre tags th...
Disannul asked 23/3, 2011 at 13:59

3

Solved

I was wondering if it were possible to preformat text that is inside a textarea. Right now I have a textarea code that I want to add syntax highlighting and also add linenumbers so I am trying to w...
Luciferin asked 19/3, 2012 at 0:23

3

I have the following HTML: <body> Here is some code: <pre><code> Here is some fun code! </code></pre> </body> But when I preview it, because the c...
Avirulent asked 31/7, 2015 at 19:18

2

Solved

Among <xmp>, <pre> or <code>, <xmp> have been recommended[1] to display HTML code. Given html such as: <xmp> <div data-role="page" data-theme="b&quot...
Kamchatka asked 25/4, 2013 at 23:39

4

I used nl2br function for pre tags, but I've encountered a strange problem: there are 2 line breaks but there's only one <br /> tag. For example: code in line 1<br /> code in line 2&l...
Opus asked 30/6, 2012 at 14:47

8

Solved

I'm trying to write a blog post which includes a code segment inside a <pre> tag. The code segment includes a generic type and uses <> to define that type. This is what the segment look...
Heliacal asked 3/9, 2008 at 17:41

1

Solved

Is it possible to render spans within a pre tag? Basically I am showing code snippets on my site, you can see them here. I want to wrap some parts of the code in "span" tags. Right now when I add...
Chiquia asked 13/8, 2014 at 16:57

4

Solved

Is there any way to emulate the display of a pre element via CSS? For example, can I keep the whitespace intact in this div by using a CSS rule? <div class="preformatted"> Please pr...
Tamer asked 17/3, 2012 at 20:50

4

Solved

I have the following HTML: <h2>Embed Code</h2> <pre> <code> <script type="text/javascript"> var something = 'else'; </script&gt...
Joyann asked 21/2, 2012 at 21:3

© 2022 - 2025 — McMap. All rights reserved.