Designing and Development > Programming
How to center image background using CSS in html
(1/1)
Anay:
HI
I am not sure how to center image background in css. I am doing as following:
--- Code: ---.back
{font-family:Verdana, Geneva, sans-serif;
background:url('images/nbg.jpg') repeat-y;
}
--- End code ---
So how do I do it, if I do text-align=center , it has no effect on it.
Kindly guide.
Jaffery:
That is easy, all you need to add "center" directive in your "background" element property.
see it ..
--- Code: ---.back
{font-family:Verdana, Geneva, sans-serif;
background:url('images/nbg.jpg') repeat-y [b]center[/b];
}
--- End code ---
And you are done !
Navigation
[0] Message Index
Go to full version