Show the first letter of the first paragraph larger and in a different color than the rest of the text, using the ::first-letter selector.
A Pen by Nico Haemhouts on CodePen.
Show the first letter of the first paragraph larger and in a different color than the rest of the text, using the ::first-letter selector.
A Pen by Nico Haemhouts on CodePen.
This limits the number of lines of any textarea that has the attribute 'data-limit-rows' set to 'true'. The limit is the 'rows'-attribute of the textarea.
To know how many lines have been entered you have to look at the number of newline characters (\n) in the text. You could do this by splitting text on the newline character, and looking at the length of the resulting array: i.e. myText.split(/\n/g).length; This would work fine in every browser, except for one special case in Internet Explorer 8, whereby the user hits the enter key several times in a row, thus producing empty lines. In this case Internet Explorer 8 excludes all empty values from the resulting array, ie those places where the delimiters appear next to each other. The result is that the usr can enter more lines of text than permitted. This is probably also true for Internet Explorer versions lower than 8, but I didn't check.
To know which key was pressed it's b
When you paste multi-line text into a single-line text input in Internet Explorer you only get the first line. This is because IE chucks away everything after the first newline-character. Other browsers will simply replace the newline with spaces. This snippet does the same thing for IE. If window.clipboardData exists we're on IE and we should intercept the paste event to replace newlines with spaces.
A Pen by Nico Haemhouts on CodePen.
Kind of like the affix plugin in Twitter Bootstrap, but this one automatically calculates the top offset. It creates a nice stack of elements under the fixed navbar at the top of the screen.
A Pen by Nico Haemhouts on CodePen.
body { | |
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; | |
font-weight: 300; | |
} |
[ Launch: Tributary inlet ] 54f6673c3afb50caa88a by nicohaemhouts
[ Launch: CDS EventsPerSecond ] f1360d138a35326a24bc by nicohaemhouts[ Launch: Tributary inlet ] 54f6673c3afb50caa88a by nicohaemhouts
[ Launch: Force Layout NGS ] 367e5785f2d4a193c798 by nicohaemhouts
[ Launch: Force Layout NGS ] 5d0c397a427a75538639 by nicohaemhouts[ Launch: Force Layout NGS ] 367e5785f2d4a193c798 by nicohaemhouts
[ Launch: Progres Arc ] e4b8cf76b51bde574f6f by nicohaemhouts