So, i'm rather new to coding with CSS and wanted to give my profile an image background before going on to do other stuff like adding scroll bars to the sections and what not. Anyway I have:
<style>
body { background: transparent; url("http://i788.photobucket.com/albums/yy170/kazechou/bis_zpsmbxmuqac.png") no-repeat; }
</style> However, the background image does not appear. Can someone give me pointers as to why or how to fix it?
You need to take another look at the shorthand format for the background property. There should be no punctuation between the values. So "transparent URL() no-repeat" should work. There are also other things you can add to the shorthand such as background size!
Thank you!
Hmm.. so I changed it to
body {
background: transparent url("http://i788.photobucket.com/albums/yy170/kazechou/bis_zpsmbxmuqac.png") no-repeat; }
The background image still doesn't show for me. Hahaha....
Also how would you do background size? o:
[@.Sei]
hi! if you change the quotation marks to apostrophes, it'll fix the problem!
so like this:
body {
background: transparent url('http://i788.photobucket.com/albums/yy170/kazechou/bis_zpsmbxmuqac.png') no-repeat; }
I'm not entirely sure on what you're looking for for the background size, but if you're looking to make the background image cover the background of the entire browser window, I would use this code, but it's going to pixelate your image since it's pretty small!! This works best for larger images that are bigger than your computer's screen resolution.
body {
background: transparent url('http://i788.photobucket.com/albums/yy170/kazechou/bis_zpsmbxmuqac.png') no-repeat;
background-size: cover;}
Otherwise you can use something like this to squash and stretch your image if you want.
body {
background: transparent url('http://i788.photobucket.com/albums/yy170/kazechou/bis_zpsmbxmuqac.png') no-repeat;
background-size: widthpx heightpx;}