PHP
CSS/HTML
Javascript
Java
Gaming
Biking
Raspberry Pi
Programming
Other...
University

CSS/HTML

Quick Links


Centering a Div

<div style="width:100%;">
  <div style="width:550px; margin:0px auto;">
    <h1>Hello World</h1>
    <p>This div is in the middle of the page!</p>
  </div>
</div>

Stopping an Object From Being Selected

<div style=" -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none;">
    You can't select me!
  </div>

Forcing Line Brake When Using PRE tag

<pre>
  <div style="width:100px; border:1px solid black; word-wrap:break-all;white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap;">
  Doesn't matter how long this text gets, it will always wrap around onto a new line...

              Will keeps your indents too!
  </div>
</pre>

Login | Contact Me | Our Friends - npwilson.com | Clockwork Loris | Copyright (©) 2018. Clive Tech.