• Resolved raethe

    (@raethe)


    (Yes, me again. Hopefully I’ll be finished soon and able to stop bothering you lot. XP)

    Busily tweaking away at the Classic theme. I’ve successfully added a second sidebar (placed a new div layer in the header.php and added the content using a php include). There’s an image that I’m trying to place at the top of that sidebar.

    If I just place that image in the file that’s requested by the php include, the image just doesn’t show. (No broken images or anything; I might as well not have added the tag. And yeah, double-checked the HTML and the file path.)

    I thought I might be able to add the image as a background to the div layer, since I successfully styled the header that way (thanks deacon!)

    I added an empty div layer between the header and the extra sidebar divs in my php file: <div id="snap"></div>. This worked for the header, and on its own doesn’t cause any problems.

    Okay, so I found the moron mistake that was breaking all my other div layers, but it still doesn’t display my image. As far as I can tell my CSS seems correct:

    div#snap {
    	position: absolute;
    	right: 0;
    	top: 1%;
    	background-image: url(snapshot.png)
    	background-repeat: no-repeat;
    	width: 172px;
    	height: 59px;
    }

    For the sake of experiment, I tried adding an image tag to the div layer in the php file, too; still no dice.

    One other tiny question: My footer, for some reason, displays at the top of the page. I haven’t touched the footer.php file itself of the get_footer function in the index file. I did notice that the footer started misbehaving after I added those extra div layers I mentioned (which is why I brought it up in the same thread, thought it might be easier. If it’s really important to have two threads, just let me know and I’ll start another one.)

    Anyway. Thanks for any insight!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Can you provide a link for us to see it in action?

    Thread Starter raethe

    (@raethe)

    Here’s the link: https://melody.byethost8.com/

    And for the record, the layout I’m basing it off of: https://melody.byethost8.com/mine/music.php

    The nav links etcetera won’t work abecause I haven’t filled that out yet, so that’s not a concern. Oh, and beware: The CSS sheet is kind of a mess. I’ll have reorganize it in a way that makes some kind of sense eventually, but I’ve been preoccupied adding and deleting to see what’s what.

    Thanks again!

    background-image: url(snapshot.png)

    should be:

    background-image: url(“theaddress/snapshot.png”);

    Thread Starter raethe

    (@raethe)

    D’oh. Silly quotemarks.

    (Silly me!)

    Hmm. Does the URL have to be absolute? I added the quotes (but didn’t change the path) and no change.

    Thanks!

    absolute is foolproof…

    you can do the ../../../xxxx.jpg thing too though. or even /images/yourpic if it is in a directory in the same directory the css is in..

    but again, absolute is foolproof.

    Thread Starter raethe

    (@raethe)

    Hmm. I tried an absolute URL – still no luck…

    I always develop locally, so I usually just keep everything in the same directory; makes things a lot easier when it comes to uploading, and I can’t remember it giving me a problem before.

    The weird thing is that the header image I’m using works just fine with only a local, and it’s pretty much the same CSS – just a different declaration.

    background-image: url(‘theaddress/snapshot.png’) ;

    Thread Starter raethe

    (@raethe)

    Well.

    Did I mention I’m an idiot?

    (I saw that missing semi colon. Really I did!)

    Thanks for the help. ‘Tis appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Placing image file at top of sidebar’ is closed to new replies.