Создание «пузыря»


Создать «пузырь» без картинок и лишнего кода очень просто...

Решение очень простое... использует псевдо-элемент :after и работает во всех нормальных браузерах...

Все что нам понадобиться это div и немного CSS:

.speech-bubble
  {
   width: 200px;
   padding: 10px;
   background: #404040;
   color: #fff;
   font: normal 12px "Segoe UI", Arial, Sans-serif;
   -moz-border-radius: 10px;
   -webkit-border-radius: 10px;
   border-radius: 10px;
  }
  .speech-bubble:after
  {
   content: "";
   border: solid 10px transparent; /* set all borders to 10 pixels width */
   border-top-color: #404040; /* the callout */
   border-bottom: 0; /* we do not need the bottom border in this case */
   width: 0;
   height: 0;
   overflow: hidden;
   display: block;
   position: relative;
   bottom: -20px; /* border-width of the :after element + padding of the root element */
   margin: auto;
  }

Источник: http://acidmartin.wordpress.com/2010/11/25/creating-a-speech-bubble-with-css3-and-without-additional-markup/

  • Digg
  • del.icio.us
  • Facebook
  • В закладки Google
  • FriendFeed
  • LinkedIn
  • MySpace
  • Twitter
  • Google Buzz
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • БобрДобр
  • Добавить ВКонтакте заметку об этой странице

,

  1. Пока нет комментариев.
(никто не узнает)