IFeelYourPain
08-21-2008, 09:02 PM
I haven't made a website in awhile. I'm wondering how exactly to make text in the center. I have a background with borders that I have placed in the center.
body {
background-color: #FFFFFF;
background-image: url(back.jpg);
background-repeat: repeat-y;
background-position: center;
}
Now I'm wanting the text to start right after the border no matter what screen resolution you have. So I tried adding body margin-left: 35%; like so:
body {
background-color: #FFFFFF;
background-image: url(back.jpg);
background-repeat: repeat-y;
background-position: center;
margin-left: 35%;
}
However when resizing the screen it would go away from the border. I tried px and it did the same thing. Any advice?
body {
background-color: #FFFFFF;
background-image: url(back.jpg);
background-repeat: repeat-y;
background-position: center;
}
Now I'm wanting the text to start right after the border no matter what screen resolution you have. So I tried adding body margin-left: 35%; like so:
body {
background-color: #FFFFFF;
background-image: url(back.jpg);
background-repeat: repeat-y;
background-position: center;
margin-left: 35%;
}
However when resizing the screen it would go away from the border. I tried px and it did the same thing. Any advice?