Simple CSS Question

This is a discussion on "Simple CSS Question" within the Web Page Design section. This forum, and the thread "Simple CSS Question are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jan 28th, 2007, 12:37
New Member
Join Date: Jan 2007
Location: Glasgow
Age: 26
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Simple CSS Question

I'm sorry to ask such a simple question, but my mind has gone to mush.

I'm currently designing a website and I want my background to be static, i.e. when you scroll down the page the background doesn't move it's just the text that scrolls up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 28th, 2007, 13:09
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple HTML Question

body {
background: fixed;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 28th, 2007, 14:37
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: Simple HTML Question

background-attachment: fixed;
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 29th, 2007, 15:37
Reputable Member
Join Date: Dec 2005
Location: Texas
Age: 19
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple HTML Question

Yeah its not really html thats more a css question. but the two above both work.

Put what Lchad said in your <head> section
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jan 30th, 2007, 10:22
New Member
Join Date: Jan 2007
Location: Slovakia
Age: 30
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple HTML Question

<body background="picture.jpg" fixed>

http://mwblog.org
Quote:
Originally Posted by welshie View Post
I'm sorry to ask such a simple question, but my mind has gone to mush.

I'm currently designing a website and I want my background to be static, i.e. when you scroll down the page the background doesn't move it's just the text that scrolls up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jan 30th, 2007, 16:06
Reputable Member
Join Date: Dec 2005
Location: Texas
Age: 19
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple HTML Question

Quote:
Originally Posted by majo323 View Post
<body background="picture.jpg" fixed>
im not sure if that works in all browsers so your better off with Lchads and moojoos way.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jan 30th, 2007, 21:09
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple HTML Question

No, that is not correct HTML or CSS.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jan 31st, 2007, 00:58
Reputable Member
Join Date: Dec 2005
Location: Texas
Age: 19
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple HTML Question

Ok its like this:
body{
background-image: url(image.jpg);
background-position: fixed center;
}

I believe... I dont use it to much. I've only used it once. Its mostly done for myspace users.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jan 31st, 2007, 01:18
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple HTML Question

Still incorrect. The longhand is:

Code: Select all
body {
    background-attachment: fixed;
    background-color: #ffffff;
    background-image: url(image.jpg)
    background-position: center center;
    background-repeat: no-repeat;
}
and the shorthand is:
Code: Select all
body {
    background: #fff url(image.jpg) no-repeat fixed 50% 50%;
}
I did a google search to make sure, and what do you know, my site came up as the 5th result!!!
http://ryanfait.com/articles/2006/10...css-shorthand/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jan 31st, 2007, 12:22
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple HTML Question

Quote:
Originally Posted by majo323 View Post
<body background="picture.jpg" fixed>
Oh dear! There are 2 things wrong in that simple little chuck code

If majo323 comes back ... here's what's wrong:

1- the background attribute is deprecated and should be replace with CSS (see Ryan's last post)

2- Where did you get the fixed attribute?! I don't see it anywhere in the list of attributes from the W3C

There ... hope that help you understand what moojoo and Ryan were saying about the code you wrote
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
static background

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
hopefully a simple question newoptical Hosting & Domains 9 Sep 21st, 2007 22:02
simple question Daniel Web Page Design 29 Feb 6th, 2007 17:23
a simple question (I think) Colm Osiris Web Page Design 2 Feb 5th, 2006 09:17
A simple Question... Lizard- Classic ASP 11 Aug 11th, 2004 08:45


All times are GMT. The time now is 15:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42