How do I wrap text in a pre tag?

The answer, from this page in CSS: pre { white-space: pre-wrap; /* Since CSS 2.1 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ }

Flexbox: center horizontally and vertically

I think you want something like the following. html, body { height: 100%; } body { margin: 0; } .flex-container { height: 100%; padding: 0; margin: 0; display: flex; align-items: center; justify-content: center; } .row { width: auto; border: 1px solid blue; } .flex-item { background-color: tomato; padding: 5px; width: 20px; height: 20px; margin: 10px; … Read more

How can I position my div at the bottom of its container?

Likely not. Assign position:relative to #container, and then position:absolute; bottom:0; to #copyright. #container { position: relative; } #copyright { position: absolute; bottom: 0; } <div id=”container”> <!– Other elements here –> <div id=”copyright”> Copyright Foo web designs </div> </div>

Changing the color of an hr element

I think you should use border-color instead of color, if your intention is to change the color of the line produced by <hr> tag. Although, it has been pointed in comments that, if you change the size of your line, border will still be as wide as you specified in styles, and line will be … Read more

What’s the difference between and , and ?

They have the same effect on normal web browser rendering engines, but there is a fundamental difference between them. As the author writes in a discussion list post: Think of three different situations: web browsers blind people mobile phones “Bold” is a style – when you say “bold a word”, people basically know that it … Read more

How to Right-align flex item?

A more flex approach would be to use an auto left margin (flex items treat auto margins a bit differently than when used in a block formatting context). .c { margin-left: auto; } Updated fiddle: .main { display: flex; } .a, .b, .c { background: #efefef; border: 1px solid #999; } .b { flex: 1; … Read more

How to disable a link using only CSS

From this solution: [aria-current=”page”] { pointer-events: none; cursor: default; text-decoration: none; color: black; } <a href=”https://stackoverflow.com/questions/2091168/link.html” aria-current=”page”>Link</a> For browser support, please see https://caniuse.com/#feat=pointer-events. If you need to support Internet Explorer, there is a workaround; see this answer. Warning: The use of pointer-events in CSS for non-SVG elements is experimental. The feature used to be part of … Read more