Skip to content

Instantly share code, notes, and snippets.

@b1tranger
Last active November 8, 2025 09:22
Show Gist options
  • Select an option

  • Save b1tranger/b4b87e78cc349a3dee0a530ea1605aa8 to your computer and use it in GitHub Desktop.

Select an option

Save b1tranger/b4b87e78cc349a3dee0a530ea1605aa8 to your computer and use it in GitHub Desktop.
My Website Development Record (Cheat Sheet)

My personal record of web development journey. You can use it as a Cheat Sheet.


Contents


Other Cheat Sheets



Contents:


HTML:

<div style="justify-content: center;display:flex;">
<hr style="border: 5px solid rgba(0, 0, 0, 0.619); border-radius: 5px;margin-left: 150px;margin-right: 150px;margin-bottom: 50px;min-width: 200px;width:50%;max-width: 500px;;">
</div>
Symbol Hex (starts with & or &#)
< &lt;
> &gt;
{ &#123;
} &#125;
( &#40;
) &#41;
[ &#91; or &lbrack;
] &#93; or &rbrack;
/ &#47;
\ &#92;
" " (white space) &nbsp;
&rarr;
&larr;
&ndash; or &#150;
&mdash; or &#151;
&minus; or &#8722;

see more: w3schools, Rapidtables

<meta http-equiv="refresh" content="3;url=oopGame.php">


Contents


  • width: -webkit-fit-content;
  • width: -webkit-fill-available;
  • .class::-webkit-scrollbar{ display:none;} // hides scrollbar

Libraries: Awesome SCC

CSS:

.idUITSstopMidScreen, #UITS { /*both class and id work*/
scroll-margin-top: 40vh;
/* 50vh = half the viewport height */
}

HTML:

<a href="#UITS">UITS</a>
<div class="idUITSstopMidScreen" id="UITS">UITS</div>
::-webkit-scrollbar {
  display: none;
}

CSS: source

html {zoom: 160%;}
-moz-user-select: none;
-ms-user-select: none;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
-khtml-user-select: none;

But these 3 lines cause the texts to be unselectable (remove them when you want your links to be selectable):

-webkit-user-select: none;
user-select: none;
-khtml-user-select: none;

You can style the properties inside the elements called "Pseudo Elements". Example: Placeholder → Pseudo element (Text inside input fields (i.e search bar, form name))

    input[type="tel"]::placeholder{color: red;}
  • 2.7.1 - Multiple elements with same class name: a.textformat , div.textformat , h1.textformat

      <a class=”textformat”></a>
      <div class=”textformat”></div>
      <h1 class=”textformat”></h1>
    
Property Purpose
word-wrap Break long words
overflow-wrap Same as word-wrap (modern)
white-space Controls space and line breaks
flex-wrap Wrap flex items
grid-template-columns with auto-fit/fill Auto-wrap grid items
text-wrap Experimental text balancing
word-break Force break anywhere in word
hyphens Add hyphens in wrapped words

Logic: "overflow-x"'s direction: "ltr" or "rtl" works horizontally, and "overflow-y"'s direction: "ltr" or "rtl" works vertically. There is no "utd" (up-to-down) or "ttb" (top-to-bottom) for vertical overflow.

image

js alts for easy implementations

Doc links: MDN

  • font awesome <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

Doesn’t work without meta viewport

	html {
		scroll-behavior: smooth;
	}


my js note


Contents:


Google adds their trackers, and clicking on links gives a redirect notice. It’s Google’s safety feature they add when google doc is converted into HTML page. How to remove it:
JS:

<script> 
document.querySelectorAll('a[href*="www.google.com/url?q="]').forEach(link => {
const url = new URL(link.href);
const realUrl = new URLSearchParams(url.search).get('q');
if (realUrl) link.href = realUrl;
});
</script>

changing <a> properties when it cannot contain target="_blank". For example, inside <select> tag's value="".

<label for="linkDropdown">Go to:</label>
  <select id="linkDropdown">
    <option value="">-- Select a page --</option>
    <option value="https://example.com">Example</option>
  </select>

  <script>
    const dropdown = document.getElementById('linkDropdown');

    dropdown.addEventListener('change', function () {
      const url = this.value;
      if (url) {
	window.open(url, '_blank'); // or use _self for same tab
      }
    });
  </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment