Hi everyone! I hope that you all are having a beautiful day.
I am trying to design a portfolio website using HTML/CSS and JS. I am done with the animations, switching to a navigation bar, and the website’s general design. When I wanted to add some content to my website as text, I saw that the div with the website content expanded to the top of the webpage and went through the navbar.
How I want it to behave is that the div will always start aligned centered and below the navbar itself. I know I have to do something with the relative positioning, but I am unsure how. At the same time, my div should expand down as much as needed so that I can scroll through the website. While trying to fix this, the div became scrollable rather than covering the whole page and making it scrollable.
I hope that someone can help me with this. Thank you so much.
Okay so one. I’m confused on why you have CSS in the index.html file. Your page should look like this. They give you 3 pages to start with HTML, CSS, and JS. The script in the index.html file seems fine, as it is defined, also if the script is JS I’d write the script like this, but I’m unsure if codepen allows that.
Hello, I put all your code in three files HTML,CSS and JS then linked everything just to make it simple. Also commas in your CSS in-between the selectors, I solved the text issue but changed the layout so looks like more work needed. Good luck
It should be now, I’m not sure if it is, but it should be, I’m unable to fix the border as I don’t know where it starts but I fixed the CSS, HTML, and JS file seperation.
So I fixed the spacing with the border, I’m still working on the nav bar, It honestly might be a height thing, or padding, ok so I got it scrollable by adding the code to the div that has the about me section. The about me section when in full page preview in codepen, it actually under the nav bar.
Hi there. Set the navbar to position: fixed with a defined height and z-index to keep it at the top. Add a margin-top to the content div equal to the navbar’s height to prevent overlap. Ensure body and html allow natural content expansion for proper scrolling.