Reputation: 4492
I'm displaying programming content on my HTML page using light yellow boxes, similar to this page. To make a yellow box, I use a <p>
tag with a special class, and for that class I put in a background color as well as font-family: "Courier New"
.
Between lines within the same box, I use the <br/>
tag to break line. Now the problem is that, as you can see in that link, sometimes there's supposed to be some space after the line break. But the space doesn't show up for me. How can I make it appear?
Upvotes: 2
Views: 2579
Reputation: 3691
Use the <pre>
tag, like the example, instead of <br/>
.
<pre>
<span class="ruby-comment"># File actionpack/lib/action_view/helpers/url_helper.rb, line 324</span>
<span class="ruby-keyword">def</span><span class="ruby-keyword ruby-title">button_to</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">html_options</span> = {}) <span class="ruby-identifier">html_options</span> = <span class="ruby-identifier">html_options</span>.<span class="ruby-identifier">stringify_keys</span>
...
<span class="ruby-node">"#{tag(:form, form_options, true)}<div>#{method_tag}#{tag("input", html_options)}#{request_token_tag}</div></form>"</span>.<span class="ruby-identifier">html_safe</span>
<span class="ruby-keyword">end</span>
</pre>
Upvotes: 2
Reputation: 128991
Don't use a paragraph for that; use a pre
:
<pre>first line
second line; next line will be blank
fourth line</pre>
Upvotes: 3