Can you apply CSS only on text that is wrapped, i.e. the second and subsequent lines?

Yeah, sort of — I’d suggest combining padding-left and text-indent: .test { width:200px; } .test label { display: block; padding-left: 1em; text-indent: -1em; } <div class=”test”> <label for=”2question1″> <input type=”checkbox” id=”2question1″ name=”2question” title=”Merknaam 1″ /> Very long text which is wrapped on the next line </label><br> <label for=”2question2″> <input type=”checkbox” id=”2question2″ name=”2question” title=”Merknaam 2″ /> … Read more

HTML Text Input: Avoid submit when enter is pressed

Using jQuery: <script> $(‘#first_page’).keypress(function(e) { if (e.keyCode == ’13’) { e.preventDefault(); //your code here } });​ </script> using javascript <input type=”text” id=”first_page” onPaste=”” onkeydown=”if (event.keyCode == 13) { alert(‘enter’);return false;}” />

Flexbox not full width

The container actually is 100% wide, i.e. spans the full width of the window. But with the default flex settings, its children will simply align left and will be only as wide as their contents. However, if you apply flex-grow: 1; to the child elements to allow them to get wider, they will stretch and … Read more

Remove white space below footer [closed]

There are three solutions to this problem In all of the following examples I’ve included an extremely basic HTML-template by only using three divs: header, content and footer. All the options are minified but should work fine on more advanced websites. Using the background-color Set for both the body and footer the same background-color. body … Read more

CSS: last-child of parent

You can use .parent > *:last-child or just .parent > :last-child An asterisk (*) is the universal selector for CSS. It matches a single element of any type. Omitting the asterisk with simple selectors has the same effect. .parent > *:last-child { background-color: red; } <div class=”parent”> <p>First child</p> <input type=”text” placeholder=”Second child” /> <div>Third … Read more