<style type="text/css">
      .boxed { border-style: solid; border-top-width: 1px; border-bottom-width: 1px;
               border-left-width: 0px; border-right-width: 0px}
      }
      .highlight_green { background-color: #00FF00; color: green}
      .highlight_red { background-color: red; color: red} 
      .green { border-color: green; }
      .red { border-color: red; }
    </style>
    <div>
      <span class="highlight_green"> </span><span class="boxed green">green</span><span class="highlight_green"> </span>
      <span class="highlight_red"> </span><span class="boxed red">red</span><span class="highlight_red"> </span>
    </div>
    

 green   red 

Valid XHTML 1.0!