Compact/Loose divs

by David Gonzalez

HTML

<p class="compact">For more information, please visit: http://csstricks.com/thisisanonexistentandreallylongurltoaddtoanytextinfactwhyareyoustillreadingit.</p>

CSS

.compact {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.loose{  
  text-overflow: unset;  
  white-space: normal;
  word-wrap: break-word;
  color:blue;
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

JavaScript

$(".compact").click( function(){
	$(this).toggleClass("loose");
});