I am creating a website in java script \ HTML and I need a advanced background

  • Thread starter Thread starter jesman789
  • Start date Start date
J

jesman789

Guest
code....please help? I need to know the entire code for making any background image on a website fit to the users resolution. I went on my computer and since i had such higher resolution on mine that i do on a different computer, it made the image repeat itself on the web page. anyways i need the code for automatically resizing or fitting the background image to the users resolution. PLEASE HELP...thanks so much.
 
You can't. You can only resize using the image tag. The background CSS attribute is just about placement inside an element and how it repeats itself.

BUT, you can put an element over top another element with the img tag in which the image's width and height are 100%

You just have to take advantage of z-index and position: absolute or position: relative. Then adjust the position of the element acting as the overlay using left: and top:
 
Back
Top