I am trying to place a border around the body of a page. I would use 4 different images, each representing a different drop shadow. I have not read anywhere online how to do this. Anyone know how to do it? Here is the code... body { margin-left: auto; margin-right: auto; margin-top:15px; width: 779px; background-color: #41555F; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:#fff; border-right: IMAGE HERE border-left: IMAGE HERE border-top: IMAGE HERE border-bottom: IMAGE HERE }
No, you can not that way. To have a better idea you can check this article at ALA There are many ways to do it, but for now is not possible that easy.
It is in CSS3 and also Safari lets multiple images per element. I don't think it's a great idea to set a width on the body itself-- I prefer sticking it on a wrapper div or something, and set a width on that. Bascially, though, you get only one image per element, thus the reason people sometimes make "sandbag" elements... elements who'd only reason for existance in the HTML is for holding images.
I was trying the same thing but recently, I found a way online to put divs next to each other using css float. Using that you can make divs look like so on a page <div>top</div> <div>left</div<div>middle</div<div>right</div> <div>bottom</div> Then all you have to do is replace top left middle etc with whatever you want - i used a broken down TV screen! Its not perfect but check it out on www dot osinova dot com slash sampleCode dot html click on html then css on the drop down menu and you will find it there Give me a second from the date/time of this post, im uploading it now...
I believe you could do this without images and use jQuery. I second the notion of not adding a width to the body tag. The only time I do that is if IE gets that ungodly horz. scrollbar. Add them to a wrapper div and not the body tag.
You can do it like this -moz-border-image:url(border.png) 30 30 round; /* Firefox */ -webkit-border-image:url(border.png) 30 30 round; /* Safari */ -o-border-image:url(border.png) 30 30 round; /* Opera */ border-image:url(border.png) 30 30 round;
I was about to say, yeah, you can do it with CSS3... as sms4promotion posted -- just beware it won't work in IE. though if all you are doing is shadows, you might want to not use images at all and just use box-shadow... BODY won't accept box-shadow (even inset) but an extra wrapping DIV set to 100% min-height can be used instead. I do that on this site of mine: http://www.ewiusb.com/ html,body { height:100%; // so inner div can get min-height. position:relative; // opera bugfix } body:before { /* Opera min-height Fix */ content:" "; height:100%; float:left; width:0; margin-top:-9999em; } #pageWrapper { overflow:hidden; min-height:100%; -moz-box-shadow:inset 0 -128px 128px 1em #000; -moz-box-shadow:inset 0 -128px 128px 1em #000; -webkit-box-shadow:inset 0 -128px 128px 1em #000; box-shadow:inset 0 -128px 128px 1em #000; } Code (markup): then it's just </head><body> <div id="pageWrapper"> Page content here <!-- #pageWrapper --></div> </body></html> Code (markup): Shadows whole way around outer edge, works in all modern browsers (even IE9).