Показване само на определена част от снимка?

streleca_stz

Registered
Здравейте!

Искам да ви попитам как се прави номерът да се взима само една част от снимка и да се показва? Понеже забелязвам, че има сайтове на които дизайна им е само 1 картинка..
И друго исках да попитам - по този начин по-бързо ли зарежда страницата?
 
Как така дизайнът ще е само една картинка? И не, като е една голяма картинка, ще зарежда по-бавно, то колкото ако са малки, оптимизирани малки картинки...
 
CSS Sprites, за тях говориш.
http://css-tricks.com/158-css-sprites/
ето и как се правят. И е общо взето, всичките ти изображения са на 1 *.png файл, и просто настройваш чрез background-position опцията в CSS позицията на картинката която ти трябва.
 
Има и доста недостатъци:
I’ve seen this technique used for a number of years, but mostly in navigation before.

While I understand the principles behind it, it really just doesn’t make a lot of practical sense (aside from the request argument) to do this.

The reason I mainly dislike this probably comes from my bias of having worked on a site using it, that I didn’t originally design. I didn’t have the original graphic files, and it was a pain to have to try to recreate it from scratch (when all I wanted to have to do was change one little icon and not have to worry about the other 4 in the same graphic).

Better site performance, maybe a little. I would say the biggest time hit on most sites are server-side these days, especially with all the database driven platforms out there now.

It’s worth it if you’ve got the time I say, but I say especially if you are under deadlines it could cost you more than it’s worth.
 

Back
Горе