02 января 2008 ~ 4983 Комментария

Заменяем текст на картинку

Css

cssreplace

Хочу подробно описать способ замены текста на картинку, способ самый что не наесть правильный, лидер из подобных способов на сайте «Css Tricks».

Заменить слово на картинку это отличный способ совместить и красоту оформления, и поисковую оптимизацию. К примеру, заменить заголовок в самом верху страницы, допустим, «Пластиковые окна» на ваш логотип или этот же текст, только графически.

Это будет радовать глаз Вашего посетителя! :-)

Принцип способа

Juice full

Мы размещаем заголовок со встроенным в него блоком с фоном(нужной нам картинкой) который будет накладываться поверх заголовка.

Приемущества этого способа:

  • При отключенной графике с включенным css будет виден заголовок.
  • При отключенном css так же будет виден заголовок.

Техническая сторона

<h1 class="technique-eight">
<span></span>Компания "Поющие выдры"
</h1>

h1.technique-eight {
	width: 350px; height: 75px;
	/* Размеры нужного нам блока */
	position: relative;
	}

h1.technique-eight span {
		background: url("images/header-image.jpg");
		/* Наша картинка */
		position: absolute;
		width: 100%;
		height: 100%;
	}

Приводить пример данного способа я не счел нужным ибо и так все предельно понятно. Всем моим читателям приятного дня ;-)

4983 Комментария для “Заменяем текст на картинку”

  1. kuzmi4 2 апреля 2008 at 18:30 Permalink

    Спасиб. Попробую.

  2. Igor 2 апреля 2008 at 19:29 Permalink

    А еще лучше добавить
    к h1.technique-eight {… overflow:hidden} чтобы при увеличении шрифта снизу ничо не полезло. Ну и оформление задать при отрубленной картинке нормальное :)

  3. Я собственной персоной 2 апреля 2008 at 19:40 Permalink

    А еще лучше добавить
    к h1.technique-eight {… overflow:hidden} чтобы при увеличении шрифта снизу ничо не полезло. Ну и оформление задать при отрубленной картинке нормальное :)

    В вся «соль» и была в отсутствии overflow:hidden и прочего. А как задать оформление при отрубленной картинке?

  4. Igor 2 апреля 2008 at 19:56 Permalink

    Ну я допустим делаю так.

    .a-title {position:relative; color:#bf0; font:22px Georgia; text-transform:uppercase; overflow:hidden}
    .a-title span {position:absolute; top:0; left:0; width:100%; height:100%}

    Подбираю максимально похожий шрифт. Вот один из примеров radioba.by

    Или если зайти на new.onliner.by и отрубить графику, то можно увидеть что логотип практически идентичный.

    Конечно такая техника не проходит когда у нас все в градиентах :(

  5. Я собственной персоной 2 апреля 2008 at 20:04 Permalink

    Игорь, это действительно тоже очень интересный способ, думаю моих читателей так же заинтересует ваш способ.

  6. Igor 2 апреля 2008 at 20:10 Permalink

    Это тот-же способ что ты привел. Просто в твоем способе не учтено то что шрифт может увеличиваться. А следовательно вылазить за фоновую картинку.

  7. Андрей 4 апреля 2008 at 2:20 Permalink

    Я так понимаю семантичного решения не существует? Без пустых тэгов.

  8. Я собственной персоной 4 апреля 2008 at 13:14 Permalink

    Я так понимаю семантичного решения не существует? Без пустых тэгов.

    Существует, но они мение удобны. Да и пустые теги не так уж и страшно.

  9. uggallery 4 апреля 2008 at 20:23 Permalink

    Для IE без экстра-разметки не обойтись (или без expression), а для современных браузеров можно использовать псевдо-класс :before и свойство content. Есть статья по теме – http://tinyurl.com/6hs4x9

  10. Паша 7 апреля 2008 at 5:01 Permalink

    А alt тогда на что?…

  11. Я собственной персоной 7 апреля 2008 at 13:06 Permalink

    А alt тогда на что?…

    Чего? Чего?

  12. uggallery 7 апреля 2008 at 16:34 Permalink

    А alt тогда на что?…

    Alt – для изображений являющихся контентом. А замена текста нужня для декоративных целей – для украшения. Разделение контента и оформления, понимаешь.

  13. Я собственной персоной 7 апреля 2008 at 16:42 Permalink

    А alt тогда на что?…

    Alt – для изображений являющихся контентом. А замена текста нужня для декоративных целей – для украшения. Разделение контента и оформления, понимаешь.

    Все правильно сказали! :-)

  14. tenshi 11 апреля 2008 at 1:15 Permalink

    вообще-то, для этого предназначен альт. учите хтмл.

  15. Я собственной персоной 11 апреля 2008 at 16:04 Permalink

    вообще-то, для этого предназначен альт. учите хтмл.

    Альт не виден при отключенный картинках, поймите это.

  16. Слава 8 сентября 2009 at 21:44 Permalink

    Интересный способ, надо бы попробовать!

  17. Алексей 24 сентября 2009 at 3:09 Permalink

    Тоже думал использовать такой метод, но с точки зрения поисковой оптимизации все ли будет корректно?

  18. Слава 26 сентября 2009 at 19:00 Permalink

    Все будет отлично!

  19. anfly 3 декабря 2009 at 0:28 Permalink

    А как сделать наоборот?
    Сверху картинка, снизу текст?
    При клике на картинку, слои меняются местами…

  20. greal 6 июля 2010 at 16:36 Permalink

    Без пустых тегов нужно поставить css свойство text-indent:-9999px;

  21. Fletcher Krase 26 февраля 2012 at 6:49 Permalink

    I simply want to tell you that I’m newbie to weblog and definitely liked your website. More than likely I’m want to bookmark your website . You definitely come with beneficial article content. Thanks a lot for sharing your website page.

  22. Stafford 29 февраля 2012 at 7:04 Permalink

    Your place is valueble for me. Thanks!…

  23. Lisabeth 29 февраля 2012 at 7:07 Permalink

    You should take part in a contest for one of the best blogs on the web. I will recommend this site!

  24. Fleta 29 февраля 2012 at 7:32 Permalink

    love a lot of the stuff especially the cute design

  25. Mertie 29 февраля 2012 at 8:28 Permalink

    Forgot to ask this, who did the art for the homepage? That drawing style seems familiar.

  26. Zetta 29 февраля 2012 at 8:31 Permalink

    Aw, this was a really nice post. In idea I would like to put in writing like this additionally – taking time and actual effort to make a very good article… but what can I say… I procrastinate alot and by no means seem to get something done.

  27. Keith 29 февраля 2012 at 8:53 Permalink

    Aw, this has been a really nice post. In plan I would like to put in writing similar to this additionally * taking time plus actual work to make a very good article… but exactly what do I say… My spouse and i procrastinate a large amount and by virtually no means apparently get something perfo

  28. Ozie 29 февраля 2012 at 10:59 Permalink

    Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.

  29. maleextra review 29 февраля 2012 at 11:33 Permalink

    Top Male Extra Web site

  30. male natural enhancement solution 29 февраля 2012 at 12:45 Permalink

    Top Male Extra Web site

  31. slimweight patch review 29 февраля 2012 at 14:54 Permalink

    Finest slim weight patch,,Preferred slimweight patch,report of the slim weight patch ,2012 slimweight patch review ,slim weight patch newest review,

  32. montre gps 29 февраля 2012 at 15:04 Permalink

    Nice read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that: Thanks for lunch! «To be 70 years young is sometimes far more cheerful and hopeful than to be 40 years old.» by Oliver Wendell Holmes.

  33. Tanja Giedlin 29 февраля 2012 at 15:20 Permalink

    Outstanding slim weight patch,,Leading slimweight patch,examination of the slim weight patch ,2012 slimweight patch review ,slim weight patchmost innovativereview,

  34. scrapebox proxies 29 февраля 2012 at 15:24 Permalink

    An incredibly fascinating go via, I may possibly not concur entirely, nonetheless you do make some really legitimate factors.

  35. Cheap scrapebox list 29 февраля 2012 at 17:31 Permalink

    Thank you for sharing excellent informations. Your website is so cool. I’m impressed by the details that you?ve on this web site. It reveals how nicely you perceive this topic. Bookmarked this web site page, will come back for more articles. You, my friend, ROCK! I found just the info I already searched all over the location and just could not come across. What a perfect site.

  36. Jack 29 февраля 2012 at 17:36 Permalink

    I like this weblog it’s a master piece! Glad I noticed this on google.

  37. auto approved list 29 февраля 2012 at 18:33 Permalink

    But an additional intelligent weblog! Completely cannot wait for a great deal much more!

  38. barbecue electrique 29 февраля 2012 at 20:44 Permalink

    Its like you read my thoughts! You appear to understand so much about this, like you wrote the ebook in it or something. I believe that you simply can do with a few p.c. to force the message house a little bit, but instead of that, this is wonderful blog. A great read. I will definitely be back.

  39. camescope hd 29 февраля 2012 at 21:22 Permalink

    I don’t normally comment but I gotta say regards for the post on this perfect one : D.

  40. dog training 1 марта 2012 at 0:04 Permalink

    Doo y0u mind 1f I quoote a couple of your articles as long as I provide credit and sources back to your weblog? My blog site is in the very same area of interest as yours and my users would certainly benefit from some of the information you present here. Please let me know if this okay with you. Thanks a lot

  41. vps hosting 1 марта 2012 at 1:16 Permalink

    You made some clear points there. I did a search on the issue and found most persons will go along with with your blog.

  42. compensation consulting firms 1 марта 2012 at 1:50 Permalink

    Wow, fantastic blog structure! How long have you been running a blog for? you made blogging look easy. The whole glance of your website is fantastic, as smartly as the content!

  43. web design columbus ga 1 марта 2012 at 1:53 Permalink

    excellent points altogether, you just received a brand new reader. What may you recommend about your submit that you simply made a few days in the past? Any certain?

  44. rent a dumpster alexander ks 1 марта 2012 at 1:59 Permalink

    Bom dia galera, com certeza disparar um torpedo internet gratuito está cada vez mais difícil devido ao bloqueio das operadoras de celular. Há ainda os websites que prometem entregar meu SMS mas quase nunca chegam ao usuário final. Alguns como o Mundo oi e o Oi Torpedo funcionam mas e para as outras operadoras? E os que dizem que mandam e nada chega. Para onde está indo as meus torpedos? E para a Tim, Vivo? Alguma Idéia? Ou significa ter de pagar?. É só um desabafo, realmente está difícil achar bons sites para mandar SMS grátis.

  45. Junko 1 марта 2012 at 2:04 Permalink

    very nice post, i certainly love this website, keep on it

  46. ceramic watches 1 марта 2012 at 2:10 Permalink

    Hey There. I discovered your blog the usage of msn. That is a really smartly written article. I’ll make sure to bookmark it and come back to read more of your helpful info. Thanks for the post. I’ll definitely return.

  47. Clarisa 1 марта 2012 at 2:15 Permalink

    Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but instead of that, this is fantastic blog. A great read. I will certainly be back.

  48. Reese 1 марта 2012 at 2:17 Permalink

    You should take part in a contest for one of the best blogs on the web. I will recommend this site!

  49. Sharie 1 марта 2012 at 2:22 Permalink

    Hey there! This is type of off idea but I necessity most assist from an established blog. Is it difficult to set up the own blog? I’m not quite techincal but I can figure points out very fast. I’m thinking about creating my own but I’m not sure the place to start. Do you possess any guidelines or suggestions? With appreciate

  50. Raymond 1 марта 2012 at 2:26 Permalink

    I simply want to say I am just beginner to blogs and truly enjoyed your web page. Most likely I’m going to bookmark your blog post . You amazingly have wonderful writings. Appreciate it for revealing your blog site.


Оставить комментарий