LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-04-2004, 05:52 PM   #1
tekmorph
Member
 
Registered: Aug 2004
Location: Ohio
Distribution: Mandrake 10.0
Posts: 68

Rep: Reputation: 15
css question


Hello new to CSS and I was trying to practice something as simple as placing the image, I have searched google for hours and my code seems fine just will not place the image. I dont even get a box with the x, nothing. Could someone please tell me where I am wrong?
<html>
<head>
<STYLE type ="text/css">
BODY{
background-image:
url("../images/natesmug.jpeg");
background-repeat:
no-repeat;
background-position:
bottom right;
}
</STYLE>
</BODY>
<title>CSS Practice></title>
</head>
<h1><center><font face="adler" size=""7">Under construction check back soon...</font></center></h1>
<body>
</body>
</html>

//the url("../images/natesmug.jpeg"); works with html...//

Last edited by tekmorph; 09-04-2004 at 05:54 PM.
 
Old 09-04-2004, 06:14 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
try removing the quotes around the url... [edit] actually, that should work fine i think...

try getting rid of that </BODY> tag... there was also some typos in there... try this one:

Code:
<html>
<head>
<style type ="text/css">
body
{
background-image:
url("../images/natesmug.jpeg");
background-repeat:
no-repeat;
background-position:
bottom right;
}
</style>
<title>CSS Practice></title>
</head>
<body>
<center>
<h1><font face="adler" size="7">Under construction, check back soon...</font></h1>
</center>
</body>
</html>

Last edited by win32sux; 09-04-2004 at 06:24 PM.
 
Old 09-04-2004, 06:30 PM   #3
tekmorph
Member
 
Registered: Aug 2004
Location: Ohio
Distribution: Mandrake 10.0
Posts: 68

Original Poster
Rep: Reputation: 15
Wish I could say that worked, I'm sure your codes fine it probably is somewhere on my end...thanks for the try though.
 
Old 09-04-2004, 07:01 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
i've heard "background" is better supported than "background-image"... i'm not sure... (maybe it's a browser thing??)

anyways, try this and see:

Code:
<html>
<head>
<title>CSS Practice</title>
<style type="text/css">
body
{
background: white url(../images/natesmug.jpeg);
background-repeat: no-repeat;
background-position: bottom right;
}
</style>
</head>
<body>
<center>
<h1>Under construction, check back soon...</h1>
</center>
</body>
</html>

Last edited by win32sux; 09-04-2004 at 07:04 PM.
 
Old 09-04-2004, 07:27 PM   #5
tekmorph
Member
 
Registered: Aug 2004
Location: Ohio
Distribution: Mandrake 10.0
Posts: 68

Original Poster
Rep: Reputation: 15
wish I knew...wish I knew.This is a bummer.
 
Old 09-04-2004, 07:30 PM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
didn't work either, huh??
 
Old 09-04-2004, 08:20 PM   #7
tekmorph
Member
 
Registered: Aug 2004
Location: Ohio
Distribution: Mandrake 10.0
Posts: 68

Original Poster
Rep: Reputation: 15
no Ive tried in 3 diffrent browsers, with different images, and from different directories. I don't know I'm stumped but its probably something really easy that I just cant see right now. I dont know if I mentioned this but the html section of this works just fine, just not the CSS.

Last edited by tekmorph; 09-04-2004 at 08:22 PM.
 
Old 09-04-2004, 08:28 PM   #8
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
this is weird... lol...

i'm gonna test the code on my machine... i'll post in a little bit... hang-in-there...
 
Old 09-04-2004, 08:59 PM   #9
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
i just tried the version from post #4 and it works fine...

i'm using firefox 0.9.3 on slackware 10.0 right now...

i think you need to check the path to the image...

if the "images" directory is in the same directory as this file, then you need to eliminate the "../" at the start of the path, for example... or perhaps the image name is wrong, like, maybe it's "jpg" and not "jpeg"... i don't know, but i'm almost sure the problem is the path, or maybe the permissions of the images directory are off...


Last edited by win32sux; 09-04-2004 at 09:19 PM.
 
Old 09-04-2004, 09:19 PM   #10
tekmorph
Member
 
Registered: Aug 2004
Location: Ohio
Distribution: Mandrake 10.0
Posts: 68

Original Poster
Rep: Reputation: 15
you got it...jpg...not jpeg...thanks alot. I knew it was simple.Thanks for spending your valuable time on my post.Thank you very much.
 
Old 09-04-2004, 09:21 PM   #11
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally posted by tekmorph
you got it...jpg...not jpeg...thanks alot. I knew it was simple.Thanks for spending your valuable time on my post.Thank you very much.
you're very welcome!!!

=)
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
XHTML/CSS question: how to draw a curved box for a sidebar vharishankar General 5 08-04-2005 08:32 PM
CSS question PensJunkie Linux - General 2 07-22-2005 05:07 AM
html/css retrodict Programming 5 11-01-2004 06:56 PM
html/css hylke Programming 0 06-27-2004 02:39 PM
CSS - Constants? dushkinup Programming 1 05-02-2004 01:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration