Im reworking on the tribute page project and Im stuck trying to set up the main flow of my website. I want to position text over the right portion of the header image (the black area).
> Bonus Points:
Im having a hard time figuring out how to properly use CSS grid. My main objective of this project is to split the webpage into 3 sections; the header - where I will have an image and header text overlapping the black portion of the image, the main section - where I will add either 1-2 subsections, one being the timeline and the other being an introduction into my subject for the project, the footer - where I will have closing information. When setting up css grid, I set up values but what happens in this case where the image I selected is actually larger than the grid section I set? I like how it looks right now, but I basically want to be able to set up pages more easily and learn how to position elements properly.
If anyone has useful links for css grid or anything related to css positioning of elements I would greatly appreciate it. Every time I come back to web dev, i find myself struggling with positioning elements.
Thanks for reading! I will link my project below, any help is much appreciated!
When I used background in css, I had some complications because of how I set up css grid (the image would zoom in completely to fit the width of the page, i set it up so the site wont scroll left to right). I will look into using flexbox like you recommended. I want the image to stay positioned exactly how its like now, but by using whatever method makes the most sense setting up the structure of the site.
I think it is working properly but my CSS Grid is cutting off the image. Do you know how to set up grid responsively? So that the area for my header in this case fits perfectly with the image I want to use.
Yea I had, when you saved it did you remove the image element from the html? I tried adding the code you sent to header, body, .container and #header-img and all of them have a portion of the image cut out (I had done these on separate attempts).
Ok, I got this to work and yes it does accomplish keeping the image in that space. The thing is, I don’t think this method is ideal because it doesn’t adapt when I resize the page. When I zoom in and out the image is now locked to its background position, and the rest of the elements resize and ultimately cover up the image. Im really just stuck on this, its frustrating because I feel like it should be a simple task to layout the page with an area for a header, content, and footer that reacts and adapts to changes.
You’ll have to play around with the size attributes to get what you want
Alternatively you can do what you originally did and use position:absolute; to absolutely position the text elements and use Top,bottom,left,right though I tend to avoid positioning elements like this
I got it after tinkering around for it. Exactly like you were just saying. I had used position: absolute and then position: relative for the parent class. I think used the top/bottom/right/left properties and set up my page from scratch. Im not longer using CSS grid and its working exactly how I want it. Thank you for the help