Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

markgodley

macrumors regular
Original poster
Mar 25, 2009
135
0
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;
}
 

Attachments

  • pink_blackcopy.jpg
    pink_blackcopy.jpg
    461.6 KB · Views: 82

umiwangu

macrumors 6502
Sep 4, 2006
478
0
Malawi
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;
}

And where do you want this div to go? Inside .maincontent or outside? What about position:relative, and then left:0.
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
Try adding text-align: right to the body as well. Then you can apply a right margin as necessary.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.