1 Reply Latest reply on Mar 19, 2010 1:13 AM by osgood_

    Trying to use margin-left in css on text inside a span tag???

    TF22Raptor2

      HI all,

       

      Trying to put a 20px margin 4 lines of text. I'm new to CSS for page building and heres what I have

       

      .contactmarg {
          font-size: 11px;
          font-weight: bold;
          margin-left: 20px;
      }

       

      <td width="72" valign="top">
      <span class="contactmarg"><br />
      Email:<br />
      <br />
      Phone:<br />
      Int:<br />
      Fax:<br />
      </span>
      </td>

       


      I have no success with this, but if I add a <p> before the start of the text the first word is then spaced by 20px but not the rest????


      Do I have to use a list or something?

       

       

      If someone could show me would be much appreciated.

        • 1. Re: Trying to use margin-left in css on text inside a span tag???
          osgood_ Level 8

          TF22Raptor2 wrote:

           

          HI all,

           

          Trying to put a 20px margin 4 lines of text. I'm new to CSS for page building and heres what I have

           

          .contactmarg {
              font-size: 11px;
              font-weight: bold;
              margin-left: 20px;
          }

           

          <td width="72" valign="top">
          <span class="contactmarg"><br />
          Email:<br />
          <br />
          Phone:<br />
          Int:<br />
          Fax:<br />
          </span>
          </td>

           


          I have no success with this, but if I add a <p> before the start of the text the first word is then spaced by 20px but not the rest????


          Do I have to use a list or something?

           

           

          If someone could show me would be much appreciated.

           

          add display: block; to the .contactmarg css selector (as below)

           

          .contactmarg {
              font-size: 11px;
              font-weight: bold;
              margin-left: 20px;
              display: block;
          }