Connecting Tech Pros Worldwide Help | Site Map

how do you make your background image automatically resize itself to fit any screen

Newbie
 
Join Date: Oct 2009
Posts: 20
#1: 4 Weeks Ago
hello

i am creating a website for both my school assignment and to really upload.

could someone help me with the following question, please?

how do you make your background image automatically resize itself to fit any screen without having extra scrollbars and having the image stay fixed and the words just move?

any help would be appreciated.

TY
MusoFreak200
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,626
#2: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


Quote:

Originally Posted by MusoFreak200 View Post

how do you make your background image automatically resize itself to fit any screen without having extra scrollbars

not at all (afaik), although you might use a repeating pattern or an image, that blends into background.

… and background images do not cause scrollbars.

alternatively, instead of using the CSS background, you can make a real image as a kind of background, although it may break the layout or provide other trouble.

Quote:

Originally Posted by MusoFreak200 View Post

and having the image stay fixed and the words just move?

CSS backgrounds
Expand|Select|Wrap|Line Numbers
  1. background-position: fixed;
HTML Elements
Expand|Select|Wrap|Line Numbers
  1. position: fixed;
(not (partly?) implemented in IE)
Newbie
 
Join Date: Oct 2009
Posts: 20
#3: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


thank you so much...

but i still am having trouble understanding... where exactly do i add the "background-position: fixed;" code?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,626
#4: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


Quote:

Originally Posted by MusoFreak200 View Post

where exactly do i add the "background-position: fixed;" code?

to the CSS declaration of the element, that holds the background-image (theoretically you can add it everywhere, beside that’s making no sense at all)
Newbie
 
Join Date: Oct 2009
Posts: 20
#5: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


i don't understand so do i add it in the body... or the head... or where?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,626
#6: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


er, do you know how to apply a background in CSS?
Newbie
 
Join Date: Oct 2009
Posts: 20
#7: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


no only html... sorry i still learning in class but my teacher didn't know how...

its for an assignment
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,626
#8: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


Quote:

Originally Posted by MusoFreak200 View Post

but my teacher didn't know how...

eh?! what kind of teacher is that?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,626
#9: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


Quote:

Originally Posted by MusoFreak200 View Post

no only html... sorry i still learning in class

check out http://www.w3schools.com there are a lot of tutorials.
Newbie
 
Join Date: Oct 2009
Posts: 20
#10: 4 Weeks Ago

re: how do you make your background image automatically resize itself to fit any screen


high school...

anyway back to the code...
Reply

Tags
auto, css, html, image, resize