Help..background image

+1 Cooper Cecil · August 29, 2014
<head>
    <title>Castle, inc </title>
    
    <style type="text/css">
        body{
            background-image:url(Castle logo cropped.pdf);
        background-repeat:no repeat;}
        
        
        
    </style>
</head>
<body>
    
</body>
</html>

Ok, so I am trying this in Komodo. Its not showing up as a background. At first, I used the image as just an image and it went fine, then I decided I wanted it as a background so I can print text over the top. It is written just like Bucky said...I think. Komodo is saying the colons are not right or something and I get no image. Any help?? Something about a parsing value for background. IDK

Thanks

Post a Reply

Replies

- page 1
Oldest  Newest  Rating
+2 Courtney May · August 29, 2014
I think that maybe you can't use a pdf as a background image, or you can't have spaces in the filename.
+2 Kaveh Greenwood · August 30, 2014
How did you change the file extension? 

Also, though Isaiah's method is valid, it is not common practice anymore to use styles within the HTML tag. CSS styles are typically separate from the HTML.
+1 Isaiah Rahmany · August 29, 2014
I am just throwing random questions out there but why don't you do this?:

<html>
<head>
<title>What ever the hell you want</title>
</head>
<body background="something.jpg">
</body>
</html>

I mean have you tried this or is it not what you want?
+1 Cooper Cecil · August 29, 2014
No, I have not tried that. I was going by the css tutorial, ad they write it in the head. I'll give this a try. Thanks.

It must be the pdf thing, cuz I took out spaces and still no go. I'll try another image with a jpeg and see if that works. Thanks 
+1 Cooper Cecil · August 29, 2014
You go Courtney. No PDF in background. JPEG worked fine. Thanks!
+1 Courtney May · August 29, 2014
No problem  :)
+1 Kaveh Greenwood · August 30, 2014
What program are you saving the image in?
+1 Kaveh Greenwood · August 30, 2014
I am unsure why as well. I'm going to guess you're opening it in iPhoto on a Mac. I'm only guessing because I've never owned or used a Mac. :pinch:

I recommend using a program like GIMP, which is a free alternative to Photoshop, and opening and saving as new file type from there.

Or try this: http://pdf2jpg.net/
:)I've never used it, just Googled. 

http://lmgtfy.com/?q=pdf+to+jpg+converter+online
0 William Maguire · September 2, 2014
You need to wrap the filename in quotes,
background-image:url("Castle logo cropped.pdf");
0 Cooper Cecil · September 2, 2014
Just to documents.
  • 1
  • 2

HTML / CSS / Web Design

106,969 followers
About

Discuss, share, ask, learn and teach HTML5 and CSS3.

Links
Moderators