How to align a block XHTML text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neogazz
    New Member
    • Apr 2010
    • 55

    #1

    How to align a block XHTML text

    I have been struggling to align a block text in XHTML.

    Click image for larger version

Name:	Terms&Conditions_alignment.jpg
Views:	1
Size:	8.6 KB
ID:	5416038

    Please see the attached picture designed in MS Word, but how would you could this in XHTML??

    Note: I have used labels with width specifications to create the exact distance I require i.e. from "Terms and Conditions:" to the left justified text opposite it.

    Regards
    Gary Wilson
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    A number of ways. This will work. Adjust margin/padding as needed:
    Code:
    <p style="width:300px">Term and conditions:
    <span>Accept:<input type="checkbox" /></span>
    <br />
    <span style="float:right;width:200px;">I am the rightful owner</span>
    </p>

    Comment

    • neogazz
      New Member
      • Apr 2010
      • 55

      #3
      Thanks your ideas seem to work, however I used the following code:

      Code:
      <p class="terms"><label for="terms">Terms of use<span class="star">*</span>:</label>
      <span class="terms_conditions">I am the rightful owner of this business. Clickazone.com reserves the right to remove or change any business information on this website</span>
      <br /><br /><br /><br /><br /><br />
      <label for="accept">&nbsp;</label>Accept terms&nbsp;&nbsp;<input type="checkbox" name="Terms"/>
      </p>
      Last edited by Dormilich; Apr 25 '10, 07:24 PM. Reason: Please use [code] tags when posting code

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        Use margins and padding for that instead of breaks and spaces.

        Comment

        • neogazz
          New Member
          • Apr 2010
          • 55

          #5
          Originally posted by drhowarddrfine
          Use margins and padding for that instead of breaks and spaces.
          Thanks for the reply. Where would I place the padding and margin attributes, would this be in the <p> container style attributes or in the <span> attributes?

          Regards
          Gary Wilson

          Comment

          • drhowarddrfine
            Recognized Expert Expert
            • Sep 2006
            • 7434

            #6
            The spans specifically but there may be other areas it could be used.

            Comment

            • neogazz
              New Member
              • Apr 2010
              • 55

              #7
              Thanks! Your help has been great.

              Comment

              Working...