0

Hello

I have a small problem in the tutorial of the CSS (see below).

body
{
   width: 760px;
   margin: Self; / * To center our page * /
   margin-top: 20px; / * To avoid sticking with the top of the browser window. Try to show off! * /
   margin-bottom: 20px;    / * Ditto for the bottom of the browser * /
   background-image: url ("images / fond.png); / * A little background image to avoid having an old white background: p * /
}
<code type="Css">
4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Arkinder
0

I think it will be very helpfull if you can tell as what exactly your problem is.

0

I don't know what your problem is but I can see many problems: margin: self; does nothing. To centre, you'd need to use text-align: center; . background-image: url ("images / fond.png); will not display the image. Remove the spaces before and after the forward slash. <code type="Css"> is just wrong. Does nothing at all in any way except prevent the page from validating.

You need to provide us with information about the problem as just saying "I have a problem" means we can't help.

0

To add to Borzoi's post,

Typically the background-image property should have single quotes surrounding the destination - background-image: url('images/fond.png'); If you are trying to center the text and inline elements on your page, then use text-align: center; .

Otherwise if you are trying to center the body itself, it would be more logical to use a containing division.

<div id="container"></div>
#container {
    width: 760px;
    margin: 0 auto; /*this will center the division in the middle of the page*/
    margin-top: 20px;
    margin-bottom: 20px;
    background-image: url('images/fond.png');
}

As Kraai and Borzoi both said, without more information it is difficult to help you.


Regards, Arkinder

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.