\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{sally sung} \pdfinfo{ /Title (web-development-final-term.pdf) /Creator (Cheatography) /Author (sally sung) /Subject (Web Development Final Term Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{F09592} \definecolor{LightBackground}{HTML}{FDF1F1} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Web Development Final Term Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{sally sung} via \textcolor{DarkBackground}{\uline{cheatography.com/216190/cs/47464/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}sally sung \\ \uline{cheatography.com/sally-sung} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 12th December, 2025.\\ Updated 8th December, 2025.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CSS}} \tn % Row 0 \SetRowColor{LightBackground} Link \seqsplit{Stylesheet} & \textless{}link href="xxx.css" rel="stylesheet" /\textgreater{} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Font & font-family: Arial, Verdana, sans-serif; \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} Text \seqsplit{Decoration} & text-decoration: type (none, underline, overline, line-through) \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} Text Transform & text-transform: type (capitalize, uppercase, lowercase, none) \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} Font Variant & font-variant : type (normal, small-caps) \tn % Row Count 13 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.18988 cm} x{2.78712 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CSS}} \tn % Row 0 \SetRowColor{LightBackground} Media Query (Max) & @media screen and (max-width: 480px) \{ ... \} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Media Query (Min) & @media screen and (min-width: 769px) \{ ... \} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Transformations (2D) & transform: rotate(30deg) scale(1.2); \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Transitions & transition: color 1.5s ease-in 0.5s, font-size 2s ease, letter-spacing 2s ease-out, text-shadow 2s cubic-bezier(0.6, 0, 0.8, 0.5); \tn % Row Count 14 (+ 8) % Row 4 \SetRowColor{LightBackground} Keyframe & @keyframes spin \{ 0\% \{top: 0;\} 100\% \{top: 100px;\} \} \tn % Row Count 17 (+ 3) % Row 5 \SetRowColor{white} Applying Animation & video \{ animation: spin 4s linear infinite; \} \tn % Row Count 20 (+ 3) % Row 6 \SetRowColor{LightBackground} Control Animation (checked) & \seqsplit{input\#rotateVideo:checked} \textasciitilde{} video \{ animation-play-state: running; \} \tn % Row Count 24 (+ 4) % Row 7 \SetRowColor{white} Control Animation (not checked) & \seqsplit{input\#rotateVideo:not(:checked)} \textasciitilde{} video \{ animation-play-state: paused; \} \tn % Row Count 28 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.28942 cm} x{2.68758 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{HTML1}} \tn % Row 0 \SetRowColor{LightBackground} Linking Files & \textless{}link href="style.css" rel="stylesheet" /\textgreater{} / \textless{}script src="script.js" defer\textgreater{}\textless{}/script\textgreater{} \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} Links (Email/Phone) & \textless{}a \seqsplit{href="mailto:user@mail}.com"\textgreater{}Email\textless{}/a\textgreater{} / \textless{}a href="tel:+15551234567"\textgreater{}Call\textless{}/a\textgreater{} \tn % Row Count 12 (+ 6) % Row 2 \SetRowColor{LightBackground} Ordered/Unordered Lists & \textless{}ol\textgreater{}\textless{}li\textgreater{}item\textless{}/li\textgreater{}\textless{}/ol\textgreater{} / \textless{}ul\textgreater{}\textless{}li\textgreater{}item\textless{}/li\textgreater{}\textless{}/ul\textgreater{} \tn % Row Count 16 (+ 4) % Row 3 \SetRowColor{white} Definition List & \textless{}dl\textgreater{}\textless{}dt\textgreater{}Term\textless{}/dt\textgreater{}\textless{}dd\textgreater{}Definition\textless{}/dd\textgreater{}\textless{}/dl\textgreater{} \tn % Row Count 20 (+ 4) % Row 4 \SetRowColor{LightBackground} Text \seqsplit{(Importance/Emphasis)} & \textless{}strong\textgreater{}Important\textless{}/strong\textgreater{} / \textless{}em\textgreater{}Emphasized\textless{}/em\textgreater{} \tn % Row Count 24 (+ 4) % Row 5 \SetRowColor{white} Text (Citation/Quote) & \textless{}cite\textgreater{}Title\textless{}/cite\textgreater{} / \textless{}q\textgreater{}Quote\textless{}/q\textgreater{} \tn % Row Count 27 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{HTML2}} \tn % Row 0 \SetRowColor{LightBackground} Table Creation & \textless{}table\textgreater{}\textless{}tr\textgreater{}\textless{}th\textgreater{}Header\textless{}/th\textgreater{}\textless{}td\textgreater{}Data\textless{}/td\textgreater{}\textless{}/tr\textgreater{}\textless{}/table\textgreater{} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Row/Column} Span & \textless{}td rowspan="2" colspan="3"\textgreater{}Merged Cell\textless{}/td\textgreater{} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Table Groups & \textless{}thead\textgreater{}...\textless{}/thead\textgreater{} / \textless{}tbody\textgreater{}...\textless{}/tbody\textgreater{} / \textless{}tfoot\textgreater{}...\textless{}/tfoot\textgreater{} \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} Table Caption & \textless{}caption\textgreater{}All Times Central\textless{}/caption\textgreater{} \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{Multimedia} & \textless{}audio controls\textgreater{} \textless{}source src="cp\_overture.mp3" type="audio/mp3" /\textgreater{} \textless{}source src="cp\_overture.ogg" type="audio/ogg" /\textgreater{} \textless{}p\textgreater{}\textless{}em\textgreater{}To play this audio clip, your browser needs to support HTML5\textless{}/em\textgreater{}\textless{}/p\textgreater{} \textless{}/audio\textgreater{} \tn % Row Count 17 (+ 8) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{HTML3 (form + input)}} \tn % Row 0 \SetRowColor{LightBackground} Form & \textless{}form action="submit.php" method="post"\textgreater{}...\textless{}/form\textgreater{} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Input \seqsplit{(Text/Email/Tel)} & \textless{}input type="text" name="name" placeholder="hint" /\textgreater{} / \textless{}input type="email" /\textgreater{} / \textless{}input type="tel" /\textgreater{} I \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} Input \seqsplit{(Number/Range)} & \textless{}input type="number" min="0" max="10" step="1" /\textgreater{} / \textless{}input type="range" /\textgreater{} \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} Input \seqsplit{(Radio/Checkbox)} & \textless{}input type="radio" name="choice" value="A" checked /\textgreater{} / \textless{}input type="checkbox" name="option" /\textgreater{} \tn % Row Count 15 (+ 5) % Row 4 \SetRowColor{LightBackground} Label + Input & \textless{}label for="visit"\textgreater{}Date of visit\textless{}/label\textgreater{}\textless{}input name="visitDate" id="visit" type="date" /\textgreater{} \tn % Row Count 20 (+ 5) % Row 5 \SetRowColor{white} Field Set & \textless{}fieldset id="custInfo"\textgreater{}...\textless{}/fieldset\textgreater{} \tn % Row Count 23 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{JavaScript}} \tn % Row 0 \SetRowColor{LightBackground} Strict Mode & "use strict"; \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Variable Declaration & var count = 0; / const MAX\_VAL = 100; \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} Functions & function calculate(val) \{ return val * 2; \} \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{JavaScript}} \tn % Row 0 \SetRowColor{LightBackground} Date Accessors & \seqsplit{now.toLocaleDateString()} / \seqsplit{now.toLocaleTimeString()} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Date Setters & \seqsplit{dateObj.setFullYear(2025);} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} Math (Floor/Power) & Math.floor(3.9); / Math.pow(2, 3); (2 to the power of 3) \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} Math (Random) & Math.random(); \tn % Row Count 9 (+ 1) % Row 4 \SetRowColor{LightBackground} Timed Execution & \seqsplit{setTimeout("updateStatus()"}, 2000); \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} Timed Interval & \seqsplit{setInterval("runClock()"}, 1000); \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} Loop (For Structure) & for (var i = 0; i \textless{} 10; i++) \{ commands \} \tn % Row Count 16 (+ 3) % Row 7 \SetRowColor{white} Date Methods & getMinutes / getHours / getDate / getDay \tn % Row Count 18 (+ 2) % Row 8 \SetRowColor{LightBackground} Handling Illegal Operations & isNaN / isFinite \tn % Row Count 20 (+ 2) % Row 9 \SetRowColor{white} Sorting an Array & function ascending(a,b) \{ return a-b; \} \tn % Row Count 22 (+ 2) % Row 10 \SetRowColor{LightBackground} Finding and Extracting Characters and Substrings & charAt / charCodeAt / indexOf / subString / replace \tn % Row Count 25 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.94103 cm} x{3.03597 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{JavaScript - DOM}} \tn % Row 0 \SetRowColor{LightBackground} Javascript HTML DOM Events & \textless{}h2 onclick="changeText(this)"\textgreater{}Click to change the text\textless{}/h2\textgreater{} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Javascript HTML DOM Events & \textless{}h2 onclick="this.style.color='red'"\textgreater{}Click to change the color\textless{}/h2\textgreater{} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} DOM Write (HTML) & element.innerHTML = "\textless{}strong\textgreater{}New Text\textless{}/strong\textgreater{}"; \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} DOM Write (Text) & element.textContent = "Plain Text"; \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{JavaScript - Event}} \tn % Row 0 \SetRowColor{LightBackground} Onload & \textless{}body onload="welcomeMsgFun()"\textgreater{} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Onmouseover\& Onmouseout & \textless{}h2 id="demo4" \seqsplit{onmouseover="function1()"} onmouseout="function2()"\textgreater{}Click this text\textless{}/h2\textgreater{} \tn % Row Count 7 (+ 5) % Row 2 \SetRowColor{LightBackground} EventListener & \seqsplit{document.getElementById("btn").addEventListener("click"}, displayDate); \tn % Row Count 12 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.74655 cm} x{4.23045 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{JavaScript - Prompt \& Confirm}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Prompt} & function func() \{ var person = prompt("Enter your name"); if (person != null) \{ \seqsplit{document.getElemntById("demo2").textContent} = "Hello " + person; \} \} \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} \seqsplit{Confirm} & function funcConfirm() \{ var text = "Press a button either OK or Cancel"; if (confirm(text) === true) \{ text = "You pressed OK!"; \} else \{ text = "You Cancled!"; \} \} \tn % Row Count 12 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}