The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

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

  • # January 10, 2010 at 6:23 pm

    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.


    Master Service Line Description


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

    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.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed