Sidebar - CSS / Want sidebar to scroll with page (not fixed!)

Hi,

I am making a CV with html and css that I’ll convert into a pdf.

On my CV I have a “sidebar”. I would like it to behave just like the rest of the page ( content reveals while scrolling ). But I can’t make it work.

Basically its not really a sidebar but a seperate section on the left side of the CV with another background color .

Here is the code right now :


#picture-section {
    position: fixed;
  background-color: rgb(224, 216, 216);
  min-width: 300px;
  top: 0px;
  left: 0px;
  width: 350px;
  height: 100%;
  z-index: 1;
}

Anyone have an advice?

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like