# Use Images with Questions

![](/files/-LRHadzd9BU56Fq-Xzma)

If you want questions to display a particular image, like shown above, here are the basic steps.

#### 1 - Upload Images to Your App in an "images" folder.

* index.html
* style.css
* code.js
* **images**
  * question1image.png
  * question2image.png

#### 2 - Add a Column in Your Spreadsheet for Image Names

![](/files/-LRHajznY29Gjc15pV4r)

#### 3 - Add HTML to Hold the Image

You may want to place this right below your question, like the example at the top of this page.

```markup
<div id="image-holder"></div>
```

#### 4 - Add the Javascript to Display the Image

You will want to add this right after `trivia.insertQuestionInfo();` in your *displayQuestion( )* function.

```javascript
if (trivia.currentQuestion.image)
    $('#image-holder').html(`<img src='images/${trivia.currentQuestion.image}'</img>`);
else 
    $('#image-holder').html(``);
```

#### 5 - Add CSS Styles

These styles will maintain the width of the image and center it on the screen. Change the styles as needed.

```css
#image-holder {
  margin: auto;
  width: 150px;
}

#image-holder > img {
  width: 100%;
}
```

That's it. It should work for you now.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.idew.org/code-trivia-app/more/code-mod-examples/use-images-with-questions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
