Setting the Font Style and Weight

The font-weight property sets the weight of the font. It increases the weight makes the text bolder.

The font-style property selects between normal, italic, and oblique fonts.

            p { 
                padding: 5px; 
                border: medium double black; 
                background-color: lightgrey; 
                margin: 2px; 
                float: left; 
                font-family: sans-serif; 
                font-size: medium; 
            #first { 
                font-weight: bold; 
            #second { 
                font-style: italic; 
            <span id="first">CSS</span> 
            <span id="second">HTML</span>
Click to view the demo
  HTML CSS Book 

  1. Font-related properties
  2. Selecting a Font with font-family
  3. Setting the Font Size
  4. Setting the Font Style and Weight
  5. Using Web Fonts