Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

image as background (HTML)


  • Please log in to reply

#1
Throntel

Throntel

    Member

  • Member
  • PipPip
  • 39 posts
A fast question:

How do i make a image the background of my site with html?
What's the code?
  • 0

Advertisements


#2
MaverickSidewinder

MaverickSidewinder

    Member

  • Member
  • PipPipPip
  • 257 posts
<body background="img.gif">

If you want to set a background color while the image is loading (so its not a white background) here is the code:

<body bgcolor="#00000" background="img.gif">

  • 0

#3
Throntel

Throntel

    Member

  • Topic Starter
  • Member
  • PipPip
  • 39 posts
mmm.... well i knew that one, but that want work while published or whatever....
Just sheck this out;

shouldn't this work?

body {
background-color: #383838;
margin:0px;padding:0px;
background-image: url(http://www.geocities...ilder/bg_02.jpg);
background-repeat: repeat-x;
background-position: top center;
}

Because i can't get the background working
  • 0

#4
TheBrotherhood313

TheBrotherhood313

    Member

  • Member
  • PipPipPip
  • 127 posts
What MaverickSidewinder said was the way for HTML
The way you are saying is CSS.
Both work, just different languages. :tazz:
  • 0

#5
Throntel

Throntel

    Member

  • Topic Starter
  • Member
  • PipPip
  • 39 posts
Well, But is it nothing wrong with the on I've written?
Because it doesn't work...

Edited by Throntel, 17 October 2005 - 07:20 AM.

  • 0

#6
MaverickSidewinder

MaverickSidewinder

    Member

  • Member
  • PipPipPip
  • 257 posts
When i comes to CSS i use dreamweaver...so don't ask me if its right or not :)

I onestly wouldn't know...

:tazz:
  • 0

#7
Tyger

Tyger

    Member 2k

  • Member
  • PipPipPipPipPip
  • 2,896 posts
It looks good to me, but are you trying to link from another site, or the site the file is on? The host server may not allow absolute links for images, or the image hosting site may not allow hotlinking. Always use relative links unless you have some compelling reason, or of course if you using another host for the images.

Something that I find very handy is to build a duplicate of a website in my machine, if possible, so that every thing can be checked.
  • 0

#8
Throntel

Throntel

    Member

  • Topic Starter
  • Member
  • PipPip
  • 39 posts
It all works now, thanks anyway
  • 0

#9
CrAzY_J

CrAzY_J

    Member

  • Member
  • PipPip
  • 45 posts

mmm.... well i knew that one, but that want work while published or whatever....
Just sheck this out;

shouldn't this work?

body {
background-color: #383838;
margin:0px;padding:0px;
background-image: url(http://www.geocities...ilder/bg_02.jpg);
background-repeat: repeat-x;
background-position: top center;
}

Because i can't get the background working

Isn't the url supposed to be in quotation marks?
  • 0

#10
Throntel

Throntel

    Member

  • Topic Starter
  • Member
  • PipPip
  • 39 posts
I don't think they have to in CSS, that one is in CSS...
Anyway I got it working without those, I wanted to know if I could do it in HTML but it seems like I had to do it in CSS
  • 0

#11
Dragon

Dragon

    All Around Computer Nut

  • Retired Staff
  • 2,682 posts

mmm.... well i knew that one, but that want work while published or whatever....
Just sheck this out;

shouldn't this work?

body {
background-color: #383838;
margin:0px;padding:0px;
background-image: url(http://www.geocities...ilder/bg_02.jpg);
background-repeat: repeat-x;
background-position: top center;
}

Because i can't get the background working



Isn't the url supposed to be in quotation marks?

in CSS the ( and ) act as the quotation marks.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP