Question: Let's say this is my folder structure,

```
project
    main_folder
         file.py
    json_files_folder
         one.json
         two.json
         three.json

```

When I run the `file.py` file it should fetch the path of the files in `json_files_folder` and open a file,
Here is my code,

```
import json
import os

try:
    file_path = os.path.dirname(os.path.realpath(__file__))
    filename = file_path + '/' + 'one' + '.json'
    with  open(filename) as file:
        data = json.load(file)
    return data
except:
     return "error"

```

what should I change in file\_path variable to make this code work?
Thanks in advance!

Answer: 
Use a background image. `background-size: contain` will aspect-fit it to the container. `background-size: cover` will aspect-fill the container.

```css
div
{
  background-image: url(https://via.placeholder.com/200x300);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 300px;
  height: 300px;
  border: 3px solid black;
}
```

```html
<div></div>
```

```css
div
{
  background-image: url(https://via.placeholder.com/200x300);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  width: 300px;
  height: 300px;
  border: 3px solid black;
}
```

```html
<div></div>
```
Just add this code `background-size: cover` inside the style attribute of image tag.