Вверх

Блог
RSS лента

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

Как сделать текст заглавными буквами

Например вам нужно что бы ссылки или заголовки текста были только заглавными буквами, тоесть верхний регистр. А так же можно сделать нижний регистр или только первые буквы заглавными. А делаеться это все просто. С помощью text-transform

Синтаксис:
text-transform: capitalize | lowercase | uppercase | none

Аргументы:

capitalize - Каждое слово в предложении будет начинаться с заглавного символа.
lowercase - Все символы текста становятся строчными (нижний регистр).
uppercase - Все символы текста становятся прописными (верхний регистр).

Пример:

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3.  <head>
  4.   <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  5.   <title>text-transform</title>
  6.   <style type="text/css">
  7.    H1 {
  8.     text-transform: uppercase; /* Заглавные буквы */
  9.    }
  10.    P {
  11.     text-transform: capitalize; /* Каждое слово начинается с заглавной буквы */
  12.    }
  13.   </style>
  14.  </head>
  15.  <body>
  16.  
  17.   <h1>Lorem ipsum dolor sit amet</h1>
  18.   <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
  19.   nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
  20.   Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit
  21.   lobortis nisl ut aliquip ex ea commodo consequat.</p>
  22.  
  23.  </body>
  24. </html>

Ваша оценка: Пусто Средняя: 4 (15 votes)

Ответить

 
  • Адреса страниц и электронной почты автоматически преобразуются в ссылки.
  • Строки и параграфы переносятся автоматически.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Image links from G2 are formatted for use with Lightbox2
  • Image links with 'rel="lightshow"' in the <a> tag will appear in a Lightbox slideshow when clicked on.
  • Links to HTML content with 'rel="lightframe"' in the <a> tag will appear in a Lightbox when clicked on.
  • Links to video content with 'rel="lightvideo"' in the <a> tag will appear in a Lightbox when clicked on.
  • Links to inline or modal content with 'rel="lightmodal"' in the <a> tag will appear in a Lightbox when clicked on.

Подробнее о форматировании

Главная | Портфолио | Услуги | Контакты | Блог