CxD Archive
Code: Trivia App
Code: Trivia App
  • About
  • Prerequisite Knowledge
  • Code Template
    • Template Build Tutorial
      • 1. Screens as Containers
      • 2. Welcome Screen
      • 3. Question Screen
      • 4. Thank You Screen
      • 5. Core JS Functions
      • 6. Load Questions and Go
      • 7. Respond to Answer Clicks
      • 8. Finishing the Game
      • 9. Visual Enhancement
    • Managing the Question DB
  • More
    • Code Mod Examples
      • Style Changes with CSS
      • Support True/False Questions
      • Add "Next Question" Button
      • Add a Category Selection Screen
      • Add Sound Effects on Answer Clicks
      • Add Basic Scoring
      • Add a Question Timer
      • Add a Question Timer with Pause Button
      • Custom Feedback Text for Individual Questions
      • Use Images with Questions
      • Display the Total Question Count at Welcome
      • Add Background Animation
    • Trivia JS Library Reference
    • P5.js
    • ★ Trivia Project Guidebook
Powered by GitBook
On this page
  • Backgrounds
  • Borders and Shadows
  • Fonts and Text
Export as PDF
  1. More
  2. Code Mod Examples

Style Changes with CSS

PreviousCode Mod ExamplesNextSupport True/False Questions

Last updated 6 years ago

Below are some basic style changes you could use to update the look of the trivia app. With CSS, the possibilities are nearly endless. Just look at this . It is easy to just try things out by trial and error. Most styles have several options to consider. So, as needed, do a Google search for "CSS" followed by a simple description of a style you are interested in, and you will likely find some answers.

Backgrounds

In your style.css file try changing or adding the following to different elements in your trivia game,--like the body, .screen, or button CSS selectors to see the result.

background: rgba(255,100,100);

Notice that there are .

background: linear-gradient(red, yellow);
/* You need an image file in your folder for this one */
background: url("paper.gif");

Borders and Shadows

border: 1px solid rgb(50,50,50);
border-radius: 10px;
box-shadow: 3px 3px 7px red;

Fonts and Text

font-family: "Times New Roman", Times, serif;
font-size: 32px;
color: blue;
text-align: right;

Want to get a unique font? Try . Hint: If you find a font you like, click the "+" for the font family then click the "family selected" bar at the bottom of the page to see instructions.

CSS reference at w3schools
background properties
many ways to define colors
Google Fonts