HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
background repeat
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
quartzy



Joined: 26 Dec 2007
Posts: 400

PostPosted: Mon Jun 09, 2008 3:22 pm     background repeat Reply with quote

I have this code for the CSS
Code:
body {
   text-align: center;
   height: 100%;
   font: .88em helvicta, sans-serif;
   background-color: #AA0080;
   background-image:url('images/back.jpg');
   background-repeat: repeat;
   }

which works well, except I do not want it to repeat. If I add this code:
Code:
body {
   text-align: center;
   height: 100%;
   font: .88em helvicta, sans-serif;
   background-color: #AA0080;
   background-image:url('images/back.jpg');
   background-repeat: no-repeat;
   }

The picture does not show at all in IE7 but the background colour shows instead. Can anyone tell me what is wrong?
sticks464



Joined: 31 Dec 2006
Posts: 934

PostPosted: Mon Jun 09, 2008 8:01 pm     Reply with quote

Try
Code:
background-image:url('../images/back.jpg');
quartzy



Joined: 26 Dec 2007
Posts: 400

PostPosted: Tue Jun 10, 2008 1:12 am     re Reply with quote

OK I will try that but I have never done it before, maybe that will help.
quartzy



Joined: 26 Dec 2007
Posts: 400

PostPosted: Tue Jun 10, 2008 2:57 am     re Reply with quote

hello
That fix did not work, but the only way I could get it to work is when I took off the background colour. So I just had a background image, I realise this is wrong but it does work.
sticks464



Joined: 31 Dec 2006
Posts: 934

PostPosted: Tue Jun 10, 2008 3:34 am     Reply with quote

I have never been able to get any styles to work using quotes if the css is embeded, only when I use an external style sheet. That's what I automatically assumed when I saw the quotes.
quartzy



Joined: 26 Dec 2007
Posts: 400

PostPosted: Tue Jun 10, 2008 1:08 pm     re Reply with quote

yes, the quotes always work OK for me, its just when I try and do the shortcuts way on the background image and colour and position etc. I can never seem to get it right. Well when I validate it, it will throw up an error of no colour for the background, but I am past all that now, as long as it works is my motto. Of course I would like to find a fix, but the internet does not seem to have one specifically for this problem, that I can find.
Dyami



Joined: 20 Jul 2008
Posts: 30

PostPosted: Sun Jul 20, 2008 10:45 pm     Reply with quote

background-repeat: repeat;
should use to set background in all over page and table.
PayneLess Designs



Joined: 28 Feb 2007
Posts: 772
Location: Biloxi, MS

PostPosted: Thu Jul 31, 2008 4:50 pm     Reply with quote

Do it the easy and proper way:

Code:
body {
   text-align: center;
   height: 100%;
   font: .88em helvicta, sans-serif;
   background: #aa0080 url('images/back.jpg') no-repeat center scroll;
   }


Or if you want contents to scroll and image fixed, change 'scroll' to 'fixed'. If you want background image position other then 'center', then use the other values you want:

op left
top center
top right
center left
center center
center right
bottom left
bottom center
bottom right
x% y%
xpos ypos

Just be sure path to background image is correct.

Cheers -
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial