Results 1 to 3 of 3

Thread: [RESOLVED] Float Right and Margin-Right ???

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Resolved [RESOLVED] Float Right and Margin-Right ???

    Hi Peeps,

    I have two divs; one floats left and the other floats right so they run next to each other. They are both in a container div. I want to bring my right div in by 20px but when I use margin-right: 20px or padding-right: 20px it does not seem to do anything. Here is the CSS:-

    Code:
    #ctl00_Content_ContentPage_Links
    {
    	padding-right: 41px;
    	width: 200px;	
    	color: black;
    	float: right;
    	text-decoration: none;
    	font-family: Verdana;
    	font-size: 8pt;
    	font-weight: bold;
    	background-color:Lime;
    }
    Thanks again for any help in my long struggle with layouts,

    Jiggy!

  2. #2
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: Float Right and Margin-Right ???

    Use > margin-right:41px;

    padding is internal to the element and by default everything will be aligned left in the div so right padding will not do anything.

    if margin-right does not work then you have another style or something effecting the div that's overriding it

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Re: Float Right and Margin-Right ???

    Hi Mate,

    I think I know what was happening; I think the margin-right is putting a margin-right inside the div and not the outside. I put a margin-right on the container div and it worked.

    Thanks for your help,

    Jiggy!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width