Sample Code and Pre-formatted Code Output

One particular HTML element that has been taking up way too much of my time lately is the <code> tag. Different browsers will render the contents of this tag differently depending on how the CSS properties (such as line-height, font, and/or font-size) are declared.

It is a constant battle to ensure that elements will render correctly, and even when you think you’ve gotten everything worked out perfectly, you may find that Safari, for instance, doesn’t know what to do with an unordered list of encoded text:

  • Safari
  • may not
  • render this
  • worth a damn

And even when you’ve gotten all that figured out, you still have to ensure that the <pre> tag is styled properly and renders consistently across a wide range of modern browsers.

#header {
    padding-top: 19px;
    padding-bottom: 19px;
    border-bottom: 1px solid rgba(0,0,0,.1)
}

#content {
    padding-top: 30px;
    padding-bottom: 30px
}

#footer {
    color: #828282;
    padding-top: 19px;
    padding-bottom: 19px;
    border-top: 1px solid rgba(0,0,0,.1)
}

.container {
    box-sizing: border-box;
    padding-left: 19px;
    padding-right: 19px
}

.container:after {
    display: table;
    clear: both;
    content: ''
}

Lorem ipsum dolor sit amet, ut dicunt invidunt nec, veritus dolores adversarium mel id. Eam integre scriptorem ei, cibo dicat eos an. In aperiam aliquando pri, et sea summo habemus tacimates. Cu diceret phaedrum cum, pri nulla cetero appellantur ne.

Te qui etiam omittam salutandi. Ludus tacimates dissentiet vis in, ferri integre perpetua te pri. Ea perpetua voluptaria mea. Mea ad agam liber mediocrem, nam sonet pertinax ad. Ei eros percipitur vix.

Eu esse offendit theophrastus eum, sea at nostro laboramus. His ea persius iudicabit, has augue perfecto iudicabit in. Mutat veniam et pri. Mei solum incorrupte ut, cu simul feugait mea, idque euismod philosophia cum cu. At facilisi complectitur mel.

Ei per inani novum numquam , an sit ipsum facilisi. Eu ornatus graecis posidonium ius. Sea an nonumes habemus adolescens, affert partiendo vituperata qui ei, mel no feugait vituperata Tritani blandit mea et, nec ea moderatius efficiendi.

Illum salutatus no sed, modo alia incorrupte eam ad. Pro cu etiam quaeque, sea an dico aliquip incorrupte. Ex his laudem everti, an sit urbanitas definiebas. Eu unum corpora omittam mei, in velit fierent per.

Related Posts :

    : :