Space after line break in paragraph

前端 未结 2 1878
伪装坚强ぢ
伪装坚强ぢ 2021-01-25 10:06

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

tag with a special class

相关标签:
2条回答
  • 2021-01-25 10:31

    Don't use a paragraph for that; use a pre:

    <pre>first line
    second line; next line will be blank
    
    fourth line</pre>
    
    0 讨论(0)
  • 2021-01-25 10:32

    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">&quot;#{tag(:form, form_options, true)}&lt;div&gt;#{method_tag}#{tag(&quot;input&quot;, html_options)}#{request_token_tag}&lt;/div&gt;&lt;/form&gt;&quot;</span>.<span class="ruby-identifier">html_safe</span>
        <span class="ruby-keyword">end</span>
    </pre>
    
    0 讨论(0)
提交回复
热议问题