Jump to content

Background code issue


panzer

Recommended Posts

and I am trying to create my first webpage so I am a novice at web design.

 

I am blocked at the point whereas I am trying to format a Background image on my page using CSS. I’ve found he command line from the forum :

 

 

body {

background-color:brown;

background-attachment: scroll;

background-image: url(images/pinkandbrown.jpg);

background-repeat: no-repeat;

background-position:absolute;

width:500px;

height:500px

top:2px

left:2px

}

 

I am able to play with the image with the above self-explanatory commands, although the problem is that I cannot adjust the size (height + width) of the Image. The positioning works fine and I can move it around but changing the image size by having different pixel values does change nothing.

 

Any Ideas?

Link to comment
Share on other sites

The positioning works fine and I can move it around but changing the image size by having different pixel values does change nothing.

Correct. The code above adds a background image to the <body> tag, which won't affect the size of the image. Any changes to the size affect the <body>, not the actual background image. To fix this, you need to open up the image in a graphics editing program (Photoshop, Paintshop Pro, GIMP, whatever) and resize it there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...