Replies

Oct 19, 2015 10 years ago
dotSei
is made of stardust
User Avatar
Bester

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>

  • {margin: 0; padding: 0;} .block, .info_block {background: transparent; border: 0; border-radius: 0; -moz-border-radius: 0;} .header {background: transparent; padding: 0; border: 0;}

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?

- Tumblr - Twitter -
Please ping me for my attention.

Oct 19, 2015 10 years ago
Sorcerer
is a worthy opponent
User Avatar
Forsake

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!

Oct 19, 2015 10 years ago
dotSei
is made of stardust
User Avatar
Bester

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:

- Tumblr - Twitter -
Please ping me for my attention.

Oct 19, 2015 10 years ago
Princess
is a Grand Champion!
User Avatar
Princess

[@.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;}

art by mei

Oct 19, 2015 10 years ago
dotSei
is made of stardust
User Avatar
Bester

That did the trick! Ahhh. Yeah. I'm probably going to find a larger image. I was just using that one as a placeholder. xD Thank you greatly!

- Tumblr - Twitter -
Please ping me for my attention.

Please log in to reply to this topic.