CSS: add background color to inline <pre> text [duplicate]

  • A+
Category:Languages

This question already has an answer here:

How do I get the gray background color as in this word which is inside an inline <pre></pre>?

Here is what I have done. From the code snippet, inline seems to be fine after the </pre> but not before <pre>.

pre.inline {     display: inline;     background-color: #80b3FF;     border-radius: 4px;     padding: 3px }
<p>We use <pre class="inline">model</pre> to specify the statistical model.</p> 

 


Other way to solve the problem using 'div' and 'span'

    .inline {     background-color: #80b3FF;     border-radius: 4px;    padding: 3px } 

<div>We use <span class="inline">model</span> to specify the statistical model.

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: