Global.css

In this example below you will see how to do a Global.css with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by vladimirs, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright vladimirs ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Global.css</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <!DOCTYPE html>
<html lang="en-US">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>JS Bin</title>

  <!-- Hide focus outline -->
  <script src="https://rawgit.com/vladimirsiljkovic/focus-outline-manager/master/focus-outline-manager.js"></script>
  <style>
    .focus-outline-hidden :focus {
        outline: none;
    }
  </style>

</head>
<body>
  <h1>This is 1st level heading bh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi luptatum zzril delenit Lorem ipsum dolor sit</h1>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, volutpat. </p>
  <h2>This is 2nd level heading</h2>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
  <h3>This is 3rd level heading</h3>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
  <h4>This is 4th level heading</h4>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
  <h5>This is 5th level heading</h5>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
  <h6>This is 6th level heading</h6>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
  <h2>Basic block level elements</h2>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>

  <address>This holds an address. Block level, but without margin or padding because they're often stacked.</address>

  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>

  <div>This is a <code>div</code> element. Lorem ipsum dolor sit amet, elit, sed diam nonummy nibh euismod tincidunt ut consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. (End of <code>div</code>.)</div>

  <h2>Figure</h2>
  <figure><img src="https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png" alt="MDN Logo">
    <figcaption>Fig1. MDN Logo</figcaption>
  </figure>

  <h2>Blockquote</h2>
  <blockquote>
      <p>This is a block quotation containing a <em>single</em> paragraph. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p></blockquote>


  <p>The following contains address information about the author, in an <code>address</code>
  element.</p>


  <h2>Lists</h2>

  <p>This is a paragraph before an <strong>unordered</strong> list (<code>ul</code>). Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>

  <ul>
    <li>One.</li>
    <li>Two.</li>
    <li>Three. Well, probably this list item should be longer. Note that for short items lists look better if they are compactly presented, whereas for long items, it would be better to have more vertical spacing between items.</li>
    <li>Four. This is the last item in this list. Let us terminate the list now without making any more fuss about it.</li>
  </ul>

  <p>This is a paragraph before a <strong>ordered</strong> list (<code>ol</code>). Note that the spacing between a paragraph and a list before or after that is hard to tune in a user style sheet. You can't guess which paragraphs are logically related to a list, e.g. as a "list header".</p>

  <ol>
    <li>One.</li>
    <li>Two.</li>
    <li>Three. Well, probably this list item should be longer. Note that if items are short, lists look better if they are compactly presented, whereas for long items, it would be better to have more vertical spacing between items.</li>
    <li>Four. This is the last item in this list. Let us terminate the list now without making any more fuss about it.</li>
    <li>Five</li>
    <li>Six</li>
    <li>Seven</li>
    <li>Eight</li>
    <li>Nine</li>
    <li>Ten</li>

  </ol>

  <p>This is a paragraph before a <strong>definition</strong> list (<code>dl</code>). In principle, such a list should consist of <em>terms</em> and associated definitions.</p>
  <dl>
    <dt>Apple</dt>
    <dd>is a fruit.</dd>
    <dt>Banana</dt>
    <dd>Is also a fruit.</dd>
    <dt>Tomato</dt>
    <dd>Is debatable. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</dd>
  </dl>

  <h2>Text-level markup</h2>


  <ul>
    <li> <abbr title="Cascading Style Sheets">CSS</abbr> (an abbreviation;
   <code>abbr</code> markup used)</li>
    <li> <abbr title="radio detecting and ranging">radar</abbr> (an abbr; <code>abbr</code> markup used)</li>

    <li> <cite>Origin of Species</cite> (a book title; <code>cite</code> markup used)</li>
    <li> <code>a[i] = b[i] + c[i);</code> (computer code; <code>code</code> markup used)</li>

    <li> an <dfn>octet</dfn> is an entity consisting of eight bits
         (<code>dfn</code> markup used for the term being defined)</li>
    <li> this is <em>very</em> simple (<code>em</code> markup used for emphasizing
         a word)</li>

    <li> type <kbd>yes</kbd> when prompted for an answer (<code>kbd</code> markup
         used for text indicating keyboard input)</li>
    <li> <q>Hello!</q> (<code>q</code> markup used for quotation)</li>

    <li> He said: <q>She said <q>Hello!</q></q> (a quotation inside a quotation)</li>
    <li> you may get the message <samp>Core dumped</samp> at times
         (<code>samp</code> markup used for sample output)</li>

    <li> <strong>this is highlighted text</strong> (<code>strong</code> markup used)</li>

    <li> the command <code>cat</code> <var>filename</var> displays the
         file specified by the <var>filename</var> (<code>var</code> markup
         used to indicate a word as a variable).</li>
    <li> In order to test how subscripts and superscripts (<code>sub</code> and <code>sup</code> markup) work inside running text, we need some dummy text around constructs like x<sub>1</sub> and H<sub>2</sub>O (where subscripts occur). So here is some fill so that you will (hopefully) see whether and how badly the subscripts and superscripts mess up vertical spacing between lines. Now superscripts: M<sup>lle</sup>, 1<sup>st</sup>, and then some mathematical notations: e<sup>x</sup>, sin<sup>2</sup> <i>x</i>, and some nested superscripts (exponents) too: Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </li>

  </ul>

  <p>Some of the elements tested above are typically displayed in a monospace font, often using the <em>same</em> presentation for all of them. This tests whether that is the case on your browser:</p>

  <ul>
    <li><code>This is sample text inside code markup</code></li>
    <li><kbd>This is sample text inside kbd markup</kbd></li>
    <li><samp>This is sample text inside samp markup</samp></li>
  </ul>

  <h2>Links</h2>

  <ul>
      <li><a href="https://developer.yahoo.com/yui">developer.yahoo.com/yui</a></li>
      <li><a href="http://yuiblog.com">the YUI Blog</a></li>
  </ul>


  <h2>Tables</h2>

  <p>The following table has a caption. The first row and the first column contain table header cells only; other cells are data cells.</p>

  <table>
      <caption>Caption: Sample table: Areas of the Nordic countries, in sq km</caption>
      <tr>
          <th>Country</th>
          <th>Total area</th>

          <th>Land area</th>
      </tr>
      <tr>
          <th>Denmark</th>
          <td>43,070</td>
          <td>42,370</td>
      </tr>
      <tr>

          <th>Finland</th>
          <td>337,030</td>
          <td>305,470</td>
      </tr>
      <tr>
          <th>Iceland</th>
          <td>103,000</td>

          <td>100,250</td>
      </tr>
      <tr>
          <th>Norway</th>
          <td>324,220</td>
          <td>307,860</td>
      </tr>

      <tr>
          <th>Sweden</th>
          <td>449,964</td>
          <td>410,928</td>
      </tr>
  </table>

  <h2>Forms</h2>

  <form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi">

      <div><input type="hidden" name="hidden field" value="42"></div>
      <div><label for="f1">Single-line text input field: <input id="f1" name="text" size="20" value="Default text."></label></div>
      <div><label for="f2">Multi-line text input field (textarea):</label></div>
      <div><textarea id="f2" name="textarea" rows="6" cols="30">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam, aperiam eaque in illum atque tempora. Fugit quaerat cupiditate, voluptatibus accusamus modi possimus aperiam itaque error natus! Provident illo dolorem reprehenderit!</textarea></div>

      <p>The following two radio buttons are inside <code>fieldset</code> element with a <code>legend</code>:</p>


      <fieldset>
          <legend>Legend</legend>
          <div>
              <label for="f3">Radio button 1</label>
              <input id="f3" type="radio" name="radio" value="1">
          </div>
          <div>
              <label for="f4">Radio button 2 (initially checked)</label>

              <input id="f4" type="radio" name="radio" value="2" checked>
          </div>
      </fieldset>

      <fieldset>
          <legend>Check those that apply</legend>
          <div>
              <input id="f5" type="checkbox" name="checkbox">
              <label for="f5">Checkbox 1</label>
          </div>
          <div>
              <input id="f6" type="checkbox" name="checkbox2" checked>
              <label for="f6">Checkbox 2 (initially checked)</label>
          </div>
      </fieldset>

      <p>

          <label for="f10">A <code>select</code> element with <code>size="1"</code> (dropdown box):</label>
      </p>

      <select id="f10" name="select1" size="1">
          <option>one</option>

          <option selected>two (default)</option>
          <option>three</option>
      </select>

      <p>
          <label for="f11">A <code>select</code> element with <code>size="3"</code> (listbox):</label>
      </p>

      <select id="f11" name="select2" size="3">
          <option>one</option>
          <option selected>two (default)</option>
          <option>three</option>
      </select>
  </form>


  <p>This next bit shows that PREformatted text is working.</p>

  <pre>
  1
   2
    3
     4
      5</pre>

  <form action="#">
    <p>
      <input type="text" placeholder="Text">
      <input type="email" placeholder="Email">
      <input type="password" placeholder="Password">
      <input type="tel" placeholder="Tel">
      <input type="url" placeholder="URL">
      <input type="number" placeholder="Number">

      <!-- ZIP: type="number" doesn't support max-length, and it's reported to have invalid markup for `pattern`
      (but `pattern` enables iOS numeric keyboard!) -->
      <input type="number" placeholder="ZIP" pattern="[0-9]*" min="1" max="99999">

      <!-- ZIP: type=text allows user to type non-numeric chars, doesn't have min and max... -->
      <input type="text" placeholder="ZIP text" pattern="[0-9]*" maxlength="5">

      <select>
        <option value="Select">Select</option>
        <option value="Select2">Select2</option>
        <option value="Select3 Select3">Select3 Select3</option>
      </select>
      <button type="reset" style="background:#fbed9c">Reset button</button>
      <button type="submit" style="background:#d3f3e9">Submit button</button>
    </p>
  </form>
</body>
</html>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/vladimirs/globalcss-LRwKRE */
:root {
    /* Typography, spacing, UI, UX */
    --font-family: Helvetica, Arial, sans-serif;
    --line-height: 1.4;
    --margin-top: 1rem;
    --margin-bottom: 1rem;
    --border-radius: 2px;
    --color: #000000;

    /* Form elements (control = input|button|select|textarea) */
    --control-font-size: 0.875rem; /* inherit */
    --control-padding: 10px;
    --control-background: #fff;
    --control-border-width: 1px;
    --control-border-style: solid;
    --control-border-color: #ccc;
    --control-border-hover: #a5a5a5;
    --control-border-focus: #585858;
    --select-arrow-width: 40px;
    --select-background: url("data:image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='#333333'><polygon points='10,0 5,6 0,0 ' /></svg>") right 15px center / 10px no-repeat, var(--control-background) linear-gradient(to right, var(--control-border-color), var(--control-border-color)) right var(--select-arrow-width) top / 1px 1px repeat-y;
}


/**
 * Global.css v0.0.1
 *
 * https://jsbin.com/hiyilopumo/edit?html,css,output
 */

/**
 * 1. Change the default box-model for easier calculations.
 * 2. Remove repeating backgrounds in all browsers.
 */
*,
::before,
::after {
    box-sizing: inherit; /* 1 */
    background-repeat: no-repeat; /* 2 */
}

/**
 * 1. Add text decoration inheritance in all browsers.
 * 2. Add vertical alignment inheritence in all browsers.
 */

/* ::before,
::after {
    text-decoration: inherit;
    vertical-align: inherit;
} */

/* Prevent adjustments of font size after orientation changes in IE and iOS. */
html {
    box-sizing: border-box;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--color);
}

/* Remove default margin from body */
body {
    margin: 0;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

/* Vertical rhythm  */
p,
ol,
ul,
figure,
blockquote,
pre,
fieldset {
    margin-top: var(--margin-top);
    margin-bottom: var(--margin-bottom);
}

/* Remove default padding from lists  */
ol,
ul {
    padding-left: 0;
}

/* Remove bullets and and numbers from list items. */
li {
    display: block;
}

/* Remove default margins in Chrome. */
/* blockquote,
figure {
    margin-left: 0;
} */

/* Reset headings font size, use headings for HTML5 Document Outline. */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    margin-top: var(--margin-top);
    margin-bottom: var(--margin-bottom);
}

/* Fix display for main in IE and Edge? */
main {
    display: block;
}

/* Make images responsive and remove bottom margin. */
img {
    max-width: 100%;
    vertical-align: middle;
}

/* Reset link styles */
a {
    text-decoration: none;
    color: inherit;
}

table {
    border-collapse: collapse;
}

/**
 * Correct the focus styles unset by the previous rule.
 */

/* :-moz-focusring {
    outline: 1px dotted ButtonText;
} */

/* Add the correct font size in all browsers. */
/* small {
  font-size: 80%;
} */

/* Prevent "sub" and "sup" elements from affecting the line height in all browsers. */
sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

/**
 * 1. Change font properties to "inherit" in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */
/* [type=button], */
/* [type=reset], */
/* [type=submit], */
[type=email],
[type=text],
[type=number],
[type=password],
[type=url],
[type=tel],
button,
select,
textarea {
    font-style: inherit;
    font-family: inherit;
    font-size: var(--control-font-size);
    margin: 0; /* 2 */
    color: inherit;
    background-color: var(--control-background);
    padding: var(--control-padding);
    border: var(--control-border-width) var(--control-border-style) var(--control-border-color);
    border-radius: var(--border-radius);
}

[type=checkbox],
[type=radio] {
    font-size: inherit;
}

/* Reset button styles and fix issues in various browsers. */
button {
    overflow: visible; /* Show the overflow in IE? */
    -webkit-font-smoothing: inherit;
    letter-spacing: inherit;
    text-transform: none; /*  Remove the inheritance of text transform in Edge, Firefox, and IE. ? */
    cursor: pointer;
    border-color: transparent; /* Override previously set rule */
}

/**
 * 1. Prevent a WebKit bug where (2) destroys native "audio" and "video"
 *    controls in Android 4.
 * 2. Correct the inability to style clickable types in iOS and Safari.
 */
/* html [type=button],
[type=reset],
[type=submit],
button {
    cursor: pointer;
    -webkit-appearance: button;
} */

::-moz-focus-inner {
    padding: 0;
    border: 0;
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */
input { /* 1 */
    overflow: visible;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from "fieldset" elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    "fieldset" elements in all browsers.
 */
legend {
    color: inherit; /* 2 */
    display: table; /* 1 */
    max-width: 100%; /* 1 */
    padding: 0; /* 3 */
    white-space: normal; /* 1 */
}

fieldset {
    border: var(--control-border-width) var(--control-border-style) var(--control-border-color);
}

/* Remove default borders from iframe in Chrome */
iframe {
    border: 0;
}

/* Remove bottom margin from textarea and inherit line-height */
textarea {
    vertical-align: top;
    line-height: inherit;
}

/* Custom select */
select {
    -webkit-appearance: none; /* Webkit */
    -moz-appearance: none; /* FF */
    -ms-appearance: none; /* Edge */
    appearance: none; /* Future */
    text-transform: none; /* Remove the inheritance of text transform in Edge, Firefox, and IE. */

    padding-right: calc(var(--select-arrow-width) + var(--control-padding));
    background: var(--select-background);
}

/* IE11 */
select::-ms-expand {
    display: none;
}

/***************************************
CUSTOM STYLES
***************************************/

/*
[type=email]:hover,
[type=text]:hover,
[type=number]:hover,
[type=password]:hover,
[type=url]:hover,
[type=tel]:hover,
select:hover,
textarea:hover {
    border-color: var(--control-border-hover);
}

[type=email]:focus,
[type=text]:focus,
[type=number]:focus,
[type=password]:focus,
[type=url]:focus,
[type=tel]:focus,
select:focus,
textarea:focus {
    border-color: var(--control-border-focus);
}

a,
input,
button,
textarea,
select {
    transition: all 0.3s ease;
}
 */

Comments