# Technical Documentation Page - Media Query Issue

**URL:** <https://forum.freecodecamp.org/t/technical-documentation-page-media-query-issue/325266>\
**Category:** General\
**Created:** [November 3, 2019, 9:45am UTC](https://forum.freecodecamp.org/t/technical-documentation-page-media-query-issue/325266 "2019-11-03T09:45:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aka1822](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@Aka1822](https://forum.freecodecamp.org/u/Aka1822)\
**Post date:** [November 3, 2019, 9:45am UTC](https://forum.freecodecamp.org/t/technical-documentation-page-media-query-issue/325266/1 "2019-11-03T09:45:47Z")

</div>

This is my project: [https://codepen.io/Aka1822/pen/MWWvyoK](https://codepen.io/Aka1822/pen/MWWvyoK), full view: [https://codepen.io/Aka1822/full/MWWvyoK](https://codepen.io/Aka1822/full/MWWvyoK)

It looks OK on desktop, but I have some issues on mobile. I managed to fit the main text somewhat OK. I chose a width of 70%, and it looks decent. I shrank the image to 100%, and that looks OKish as well. I have troubles with the navigation bar, as it is constantly on top of the page, it is not on the left as it is in desktop mode, and I am not sure what to do with it. I’ve added top, left, font size, just to see if something changes, and it doesn’t. Trying to use “position: relative;” to it seems to make it somewhat better, but not good enough.

How could I make it to behave similar to the desktop version? I am not even sure about (max-width: 600px), it was mostly trial and error, and maybe some of the code inside the media query is useless. I would really appreciate some suggestions.

Current code:

```auto
@media screen and (max-width: 600px) {
  #main-doc {
  color: red;
  width: 70%;
  padding-left: 17%
  }
  
  img {
    width: 100%;
  }
  
  #navbar {
  width: 100%;
  top: 0;
  left: 0;
  font-size: 5px;
  background-color: #F5F5F5;
  border: solid;
  border-style: hidden;
  }  
  #navul {
  width: 100%;
  top: 0;
  left: 0;
  font-size: 5px;
  }
}

```

Thanks!

---

<div class="post-metadata">

**Author:** ![pjonp](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/pjonp/32/131704_2.png) [@pjonp](https://forum.freecodecamp.org/u/pjonp)\
**Post date:** [November 3, 2019, 10:06am UTC](https://forum.freecodecamp.org/t/technical-documentation-page-media-query-issue/325266/2 "2019-11-03T10:06:30Z")

</div>

I went with flexbox for this project. Main site was columns and switched to rows when screen width got smaller.

---

<div class="post-metadata">

**Author:** ![Aka1822](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@Aka1822](https://forum.freecodecamp.org/u/Aka1822)\
**Post date:** [November 4, 2019, 5:56am UTC](https://forum.freecodecamp.org/t/technical-documentation-page-media-query-issue/325266/3 "2019-11-04T05:56:48Z")

</div>

I assume that you used flexbox just for the navbar?

---

<div class="post-metadata">

**Author:** ![pjonp](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/pjonp/32/131704_2.png) [@pjonp](https://forum.freecodecamp.org/u/pjonp)\
**Post date:** [November 4, 2019, 9:28am UTC](https://forum.freecodecamp.org/t/technical-documentation-page-media-query-issue/325266/4 "2019-11-04T09:28:01Z")

</div>

Main container was flex box:

On larger screens: flexbox columns; Nav was 100% height and X wide.

Media query: flexbox rows; Nav X height & 100% wide. (trial & error for max width. there is probably ‘design rule’ like sidebar should be 30% max width but I just went with what looked good to me 🙂 )

[https://cdpn.io/pjonp/debug/PooZqby/NQMzYBqovNqk](https://cdpn.io/pjonp/debug/PooZqby/NQMzYBqovNqk)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 2:46pm UTC](https://forum.freecodecamp.org/t/technical-documentation-page-media-query-issue/325266/5 "2021-01-16T14:46:10Z")

</div>

Closed on January 16, 2021, 2:46pm UTC


