Ignoring right margin

Discussion in 'Web Design and Development' started by markgodley, Jul 10, 2009.

  1. markgodley macrumors regular

    Joined:
    Mar 25, 2009
    #1
    Hey,

    I want to add a div that takes the position from the left margin not the right. Is there a way to get css to ignore the right margin so its always in the same place? I dont really wanna use absolute positioning I want it like this( See attachment) or is the only way to have fixed positioning.

    my css so far is:
    body
    {
    background-image: url('images/background.jpg');
    background-repeat: no-repeat;
    background-color: #D42D97;
    }

    .maincontent
    {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    margin-left: 50px;
    text-align: right;
    }
     

    Attached Files:

  2. umiwangu macrumors 6502

    Joined:
    Sep 4, 2006
    Location:
    Malawi
    #2
    And where do you want this div to go? Inside .maincontent or outside? What about position:relative, and then left:0.
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    Try adding text-align: right to the body as well. Then you can apply a right margin as necessary.
     

Share This Page