HTML Academy
Overflowing Text
Text Formatting24/26
Back to the list of tasks
  • 1. Unicode Characters
  • 2. The text-shadow Property
  • 3. Horizontal Text Shadow Offset
  • 4. Vertical Text Shadow Offset
  • 5. Text Shadow Feathering
  • 6. The Text Shadow Color
  • 7. Embedded Effect for Text
  • 8. Decorative Retro Shadow
  • 9. Challenge: Psychedelic Shadows
  • 10. Logo: Custom Font
  • 11. Logo: Icon Font
  • 12. Logo: Size Alignment
  • 13. Applying Decorative Styling to the Line, Step 1
  • 14. Applying Decorative Styling to the Line, Step 2
  • 15. The text-indent Property
  • 16. The: first-letter Pseudo Element
  • 17. : first-line Pseudo Element
  • 18. Column Markup: The column-count Property
  • 19. Column Markup: The column-width Property
  • 20. Column Markup: The column-gap Property
  • 21. Text Direction
  • 22. Text Direction and Tables
  • 23. Overflowing Text
  • 24. Spacing Between Words
  • 25. Challenge: Why So Serious?
  • 26. Challenge: Play With Fonts
Challenge: Why So Serious?
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Spacing Between Words

Finally, the last property we’ll look at in this section is word-spacing. It sets the distance between individual words and inline elements. The value can be positive or negative and can be specified in px, em, pt, or other units supported by CSS.

The word-spacing property may also be used to set the spacing between block-inline elements as well as images, since images are also considered to be inline.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>Spacing Between Words</title> <meta charset="utf-8"> <link rel="stylesheet" href="style.css"> </head> <body> <h1>The Best Photos From the Entire Collection</h1> <ul> <li><img src="mountain.jpg" alt="The Mountains"></li> <li><img src="rain.jpg" alt="Raindrops"></li> <li><img src="lens.jpg" alt="Lens"></li> <li><img src="road.jpg" alt="Road"></li> </ul> </body> </html>
CSS
body { margin: 0; min-width: 570px; background: url("bokeh.jpg") no-repeat 50% 0; color: #fffbb4; font-size: 12px; font-family: "Arial", sans-serif; } h1 { text-align: center; font-size: 24px; } ul { padding: 0; list-style: none; text-align: center; } li { display: inline-block; margin-bottom: 12px; } img { width: 250px; }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. Set the spacing between words for the heading h1 to 5px,
    2. and then set the spacing between words for the list ul to 12px.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.