Raised This Month: $ Target: $400
 0% 

(HTML) Problem with background


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dasha
Senior Member
Join Date: Apr 2012
Location: \%STEAM -> $_SESSION
Old 08-19-2012 , 23:58   (HTML) Problem with background
Reply With Quote #1

Hello, This is the most stupid question I ask, btw I'm sleeping or what .___.
Well this never happend to me! Maybe today I'm really so bad coz I don't sleep already two days..

The problem is that I don't see the background in my html file, WTF?

HTML Code:
<!DOCTYPE html>
<html>
<head>
	<title>Title of the document</title>
	<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
....
</body>
</html>
Code:
body {
	background: #fff url('img/test.jpg') no-repeat center center fixed;
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;
	
	color: #000;
}
dasha is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-20-2012 , 00:04   Re: (HTML) Problem with background
Reply With Quote #2

Are we supposed to assume that the "body" css is in style.css?????

Possibly:
  • Style sheet doesn't exist.
  • Image doesn't exist.
  • Stylesheet is not being referenced correctly.

You need to learn to debug this stuff. Put the CSS in the HTML file and see what happens. Also, you could try something more simple and see if you can rule out the first and third possibility above. You probably could have figured this out by now if you would first troubleshoot it.
__________________
fysiks is offline
dasha
Senior Member
Join Date: Apr 2012
Location: \%STEAM -> $_SESSION
Old 08-20-2012 , 00:15   Re: (HTML) Problem with background
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Are we supposed to assume that the "body" css is in style.css?????
Yes. The style.css exists, the image exists.

index.html
css
  • style.css
img
  • test.jpg

I tried in html <body background="img/test.jpg"> = Not worked, but when I disabled style.css it worked.
So the problem are in the style.css, but can't understand why when it's well writed.
dasha is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-20-2012 , 00:35   Re: (HTML) Problem with background
Reply With Quote #4

Paths to images in your CSS file are relative to the CSS file.
Therefore, your background path should be: '../img/test.jpg'
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
dasha
Senior Member
Join Date: Apr 2012
Location: \%STEAM -> $_SESSION
Old 08-20-2012 , 00:49   Re: (HTML) Problem with background
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
Paths to images in your CSS file are relative to the CSS file.
Therefore, your background path should be: '../img/test.jpg'
Now it's all ok, but why it work only with that ../
What's the difference?
dasha is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-20-2012 , 05:32   Re: (HTML) Problem with background
Reply With Quote #6

Quote:
Originally Posted by dasha View Post
Now it's all ok, but why it work only with that ../
What's the difference?
Exolent already said why.
Quote:
Originally Posted by Exolent[jNr] View Post
Paths to images in your CSS file are relative to the CSS file.
__________________
xPaw is offline
dasha
Senior Member
Join Date: Apr 2012
Location: \%STEAM -> $_SESSION
Old 08-20-2012 , 06:04   Re: (HTML) Problem with background
Reply With Quote #7

Ok thanks, my bad english -:-
dasha is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-20-2012 , 06:09   Re: (HTML) Problem with background
Reply With Quote #8

Quote:
Originally Posted by xPaw View Post
Exolent already said why.
Hello xPaw you crabster <- dang, almost forgot xD
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 08-20-2012 at 06:29.
Alka is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-20-2012 , 06:28   Re: (HTML) Problem with background
Reply With Quote #9

Quote:
Originally Posted by Alka View Post
Hello xPaw you crabster.
__________________
xPaw is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 06:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode