Jump to content

#id image background/css?


paulmo

Recommended Posts

still trying to do rounded corners have read niftycorners, spiffy, and several others including ones about creating four corners from image and doing all kinds of css coding...too much for my noob brain. so, if css body can create a background-image, is there a way to do the same in an #id column, float etc? was trying to put background-image= in #div col1 (for example) and of course getting no results.thanks for help again, this site is the best

Link to comment
Share on other sites

Here's an example of how to put a background image:div#col1 {background-image: url(file.jpg); /*The file must go within url()*/background-repeat: no-repeat;/*Other options are repeat-x and repeat-yDon't add this if you want it to repeat tiled*/background-position: top left;/*position of the background image compared to its container. You can also give pixel coordinates */background-color: #000088;}

Link to comment
Share on other sites

the following is neither working in the body nor the div#col1 css (the latter's where i really want it--trying rounded corner image). i'm just previewing this on local machine would obviously change url when uploading to host. links work fine using this preview method.only getting background color. tried removing that...still, image not showing. advice? thanks--body{background-image:url (C:\Documents and Settings\Owner\My Documents\web-test\brucepaulribbon.gif); background-repeat: no-repeat;background-position: top left;background-color: #000088;}

Link to comment
Share on other sites

I really don't recommend using absolute URLs to refer to files on your computer.Just put the image in the same folder as your CSS file or page and use this code:body{background-image: url(brucepaulribbon.gif);background-repeat: no-repeat;background-position: top left;background-color: #000088;}Don't modify anything in this code, add any extra spaces or line breaks because thn it probably won't work.

Link to comment
Share on other sites

ingolme mucho gracias! problem was floating left a div#col also in css...changed float to right and presto there is the background, and i'm able to give the div id=col its own background too...not sure why float was messing things up but will experiment...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...