Skip to content

Instantly share code, notes, and snippets.

@ravisiyer
Created February 26, 2024 12:34
Show Gist options
  • Save ravisiyer/0c016a02c36ea627920f4c677a7f2dab to your computer and use it in GitHub Desktop.
Save ravisiyer/0c016a02c36ea627920f4c677a7f2dab to your computer and use it in GitHub Desktop.
HTML Pre tag: Wrapping content
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
pre {
/* overflow-x: auto; */
white-space: pre-wrap;
/* word-wrap: break-word; */
}
</style>
</head>
<body>
<!-- prettier-ignore -->
<pre>All shown text is within pre tag and without any newlines. Style specification of pre { white-space: pre-wrap;} is used. ..... Long text that normally will result in horizontal scrollbar appearing. Long text that normally will result in horizontal scrollbar appearing.Long text that normally will result in horizontal scrollbar appearing.Long text that normally will result in horizontal scrollbar appearing.</pre>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment