Grow your CSS skills. Land your dream job.

How to align the text to right for a left float div?

  • # January 10, 2010 at 6:23 pm

    Hi,
    How can I create a form with two columns side by side, with left column text right aligned, and right column text left aligned?

    The below code doesn’t seem to work for the left column text is not getting right aligned. Please help.

    HTML

    Code:
    Master Service Line Description

    CSS

    Code:
    div.formfield-title{float: left;
    margin-left: 10px; margin-top: 5px; margin-right:0px;
    text-align: right;
    vertical-align:middle;}

    div.formfield{ text-align:right;
    vertical-align: middle;
    margin-right: 20px;
    margin-top: 5px;}

    # January 11, 2010 at 12:41 am

    You’ll probably need to assign a width to the div.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".