The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Image Scrolling, Positioned Images
jon
post Oct 3 2006, 02:23 PM
Post #1





Group: Members
Posts: 4
Joined: 3-October 06
Member No.: 317



Hello, i have just started HTML a week or two ago, and i was wondering what code i would need in order to make an image stay in the back of the page but moving up/down as you scroll so it stays in the middle of the screen, im sorrry if its not specific enough but its hard to explain. I would really appreciate some assitance for my small problem! Anything is much appreciated! ninja.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 3 2006, 02:46 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 17,967
Joined: 9-August 06
Member No.: 6



Like a background? You can do that with CSS and 'background-attachment: fixed' + a little more.

This is probably a little hard to understand if you are new, but you can save it for later.
http://www.w3.org/TR/REC-CSS2/colors.html#...ground-position
For CSS basics, read this.
http://www.htmlhelp.com/reference/css/

You could use something like this in a style sheet (you can read at the second page I linked to how you can link a style sheet to your HTML).

CODE

body  { background-color: #abc123;
        background-image: url(DL/ab.jpg);
        background-attachment: fixed;
        background-position: center center }

background-image tells what image to use
background-attachment fixed means it won't scroll with the page
background-position lets you position the background image

It can be written shorter like this ('background' is shorthand for all background properties).
CODE
body  { background: #abc123 url(pic.jpg) no-repeat fixed center }
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jon
post Oct 3 2006, 05:32 PM
Post #3





Group: Members
Posts: 4
Joined: 3-October 06
Member No.: 317



OMG thank you so much, now i can show my teacher in business class how to do this! Thanks very much for your assistance!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 3 2006, 07:00 PM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 17,967
Joined: 9-August 06
Member No.: 6



BUSINESS class? IPB Image

You are welcome nevertheless. happy.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jon
post Oct 4 2006, 12:26 PM
Post #5





Group: Members
Posts: 4
Joined: 3-October 06
Member No.: 317



yeah im in highschool 10th grade business class about online business.. we use html to create our own website and as a final project we sell a product! its alot of fun! ninja.gif also i was wondering as a html tag how do you make a immage not repeat, do you have to use a style or can you just use a different tag?, the style worked great with our site thanks for the help...

This post has been edited by jon: Oct 4 2006, 12:36 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Oct 4 2006, 12:51 PM
Post #6


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Since you're in school, I'll give you an url to find the reply by yourself

http://www.westciv.com/style_master/house/index.html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 4 2006, 01:31 PM
Post #7


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 17,967
Joined: 9-August 06
Member No.: 6



No, HTML can't do that. HTML is for structure (headings, paragraphs, lists and so on), CSS for style. HTML eventually came to include quite a lot of page style elements, but it wasn't intended for this and was never very well suited for it, hence those tools are blunt. I.E. HTML can make a background image appear, but that's it. CSS can apply it to any element, not only body, and, as you've seen, it can do a lot more with it than just make it appear.

Use each language for what it's indtended for and don't let your teacher make you write FONT tags and such. tongue.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jon
post Oct 4 2006, 02:04 PM
Post #8





Group: Members
Posts: 4
Joined: 3-October 06
Member No.: 317



thanks again!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 21st August 2018 - 10:56 PM