How to give a fixed background image on a web page?

Asked By 0 points N/A Posted on -
qa-featured

I am new to HTML.  One thing I want to know is how to set a fixed background on a web page.

SHARE
Best Answer by canari
Best Answer
Best Answer
Answered By 0 points N/A #96347

How to give a fixed background image on a web page?

qa-featured

Don’t worry.  As a new beginner, I recommended you to read more and more article as you can. You can also download more and more eBooks on Html and PHP.  You can also visit this web site to know more information.

Now open your web page in notepad or Dreamweaver ; then in the <body> tag set the background like this <body background=”(your background name.

You have to save the image file in the same folder)” (and to fix it)BGPROPERTIES="FIXED"  >. Now for example <body background= “picture.jpg”  BGPROPERTIES=”FIXED” .

Answered By 0 points N/A #96349

How to give a fixed background image on a web page?

qa-featured

Hi Miron,

 You are looking to adjust an image to the background of your website so there are several ways in order to do that in html code. Following are the method through which you can adjust the background image in html code.

<body background="miron.gif">

Here you are just inserting the background image "miron.gif" to make it appear on webpage's background.

<body background="miron.gif" bgcolor="blue">

You can further make them more interesting by using the css script. for example

Here your are changing the main background color which will appear when the background file is not fetched to the browser.

  • background (shorthand for all background properties)
  • background-attachment
  • background-color
  • background-image
  • background-position
  • background-repeat

These are background tag's properties which can have values like for background-attachment can be assigned a value =

  • scroll
  • fixed
  • inherit

Background-image can be assigned one of the following values.

  • <url>
  • none
  • inherit

Background-position can be assigned one of the following values.

  • <percentage>
  • <length>
  • inherit

Background-repeat can be assigned one of the following values.

  • repeat (background repeats both horizontally and vertically)
  • repeat-x (background repeats horizontally only)
  • repeat-y (background repeats vertically only)
  • no-repeat (background is not repeated)
  • inherit

Even Background tag itself can be assigned one or more of the following values simultaneously.

  • <background-color>
  • <background-image>
  • <background-repeat>
  • <background-attachment>
  • <background-position>
  • inherit

Happy scripting.

Hope this might help you.

Answered By 75 points N/A #96351

How to give a fixed background image on a web page?

qa-featured

Hello,

You can change the background of the image, on the web page.  Use the CSS solution, that can be created on the background image and this can cover the fixed background in HTML tag.  You create a web page in single background that can not be tiled in  the background. Check the code below for the properties in the fixed image background and edit the text indicated as needed.

<body background ="yourimage.gif" bgproperties="fixed">

Checks this 2nd code below, for the body can be moved over the image background and can prevent an image from repeating.

<STYLE TYPE="text/css"> 
<!– 
BODY { background-image: url(yourimage.jpg) }
BODY { background-repeat: no-repeat }
BODY { background-position: center }
–>
</STYLE>

Related Questions