I'm encountering an issue where a div container is automatically stretching to the full width of the page, instead of adjusting to fit the content within it. Below is the HTML code snippet:
<!doctype html>
<html>
<!-- Head -->
<head>
<title>html_blocked_text</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Area for Additional Links -->
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link href='html_blocked_text.css' rel='stylesheet' type='text/css' />
</head>
<!-- Body -->
<body>
<div id="container">
<div class='block'>
<div class='letter'>S</div>
</div>
<div class='block'>
<div class='letter'>T</div>
</div>
<div class='block'>
<div class='letter'>A</div>
</div>
<div class='block'>
<div class='letter'>Y</div>
</div>
</div>
</body>
</html>
Here's how the issue is manifested (with results displayed in 25px and 50px):
The problem lies in the excessive white space after the last letter. How can I remove the unnecessary white space on the right side of the last letter? I want the container to perfectly wrap around the content (the letters).