Menu

  •    
  • Home
  • Digital Accessibility
  • Web Accessibility Testing
    • Testing Principles
    • Automated Testing
  • Accessible Learning Materials
  • Development Principles
  • Inclusion in the learning process
  • HTML
    • HTML Syntax
    • Text Tags
  • CSS
    • CSS Syntax
    • Text Formatting CSS
  • PHP
    • PHP Syntax
    • PHP Functions

Contacts

  • t.todorov@ts.uni-vt.bg
  • 5003 Veliko Tarnovo, Bulgaria, Teodosii Turnovski St. #2

Text Formatting CSS

CSS styles for text formatting

Text formatting styles define the layout of text and include text properties and their possible values ​​in the form property: value;. They refer to various text-related selectors such as <p> and <h1> and can be used locally, in external or internal style sheets, as well as for hyperlinks, classes and identifiers.

The main text formatting properties are:
  • font-family - sets one or more font names or font families
  • font-style – specifies a font style, for example italic
  • font-weight – sets font weight such as bold, normal, etc.
  • font-size – sets the size (size) of the font in one of the measurement units, for example pt, px, in, cm or by a descriptive word like small, medium, large
  • color – specifies a text color where the value is a color name or number
  • background-color – specifies the background color of the text, its value can also be a color name or number
  • letter-spacing - sets the spacing between characters in text, with the value determining whether letters should be closer or further apart than the normal spacing for the given font and size.

  • <!DOCTYPE html> <html> <head> <style> h1 {font-family: ”Times New Roman”, “Arial”, “Verdana”, Serif;} p {font-style: italic; font-size: 14pt; color: white; background-color: green; letter-spacing: 3px;} </style> </head> <body> ... </body> </html>
    There are different recommendations for using CSS styles. For example, if the color property is set, the background-color should also be set with a good enough contrast for smooth reading.