Styling the elements of a page

A page may contain any number of different elements which each need to be styled relative to one another. It is useful, therefore, to have a single page containing a concise list of common elements such as headings, paragraphs and tables, so that these can be styled all at once. Such a page should contain … Read more

Prevent the page reloading on a form submission

The prevent the page reloading when you submit a form, call the preventDefault() method on the submit event. A form by default will send a request to a given location. Unless the action attribute is specifed, the form will send a request to the current location. The form will send the request when the submit … Read more

Create a seamless address bar display on mobile

To fill the top part of mobile displays with a custom color, insert the theme-color meta tag into your index.html document and set the content property to your chosen color. When viewing a website, the default behaviour of mobile displays is surround the address bar at the top of the screen with the browser default … Read more

Commenting your code

Comments provide useful context to your code so you and other developers can better understand the purpose of that code upon review. Comments can be used to provide information about a line of code, such as the intended function and possible inputs and outputs. Comments can also be used to hide code from being executed … Read more