0

I´m trying to set a scroll just in a div. I have my website and I´m trying to make it with the same height in all windows.

The page "brands" has part that need more height, but I don´t want the scroll in the window, I just want scroll in a div.

enter image description here enter image description here

I just want the scroll in the purple (or pink) div the rest of my website must be static.

I´m trying to get this with overflow: auto in the purple div and setting overflow hidden in the rest.

This is my current CSS:

.marcas { background-color: gold; height: 80vh; font-family: 'Josefin Slab', serif; overflow: hidden; } .title { height: 10%; /* background-color: ghostwhite; */ background-color: palegreen; color: #1f1f1f; font-size: 2.5em; padding: 3%; padding-left: 10%; text-transform: uppercase; } .brands-container { background-color: coral; overflow: hidden; } .brands-info { overflow: auto; background-color: crimson; } 

marcas:The wrap of my content (yellow) title: "Our Brands" text (green) brands-container: The div with the brand´s names (orange, salmon...) brands-info: The div with the information and slide (pink)

I think that maybe I have a div with a incorrect property or a wrap with something wrong... I don´t know.

This is the website (but I did not updated my code yet): http://mad4sneakers.com/web/eng/brands.html

1 Answer 1

1

This should work (a bit hard to say, also depends what the rest of your new code will look like):

.marcas { background-color: #F8F8FF; font-family: "Josefin Slab",serif; height: 80vh; overflow: hidden; } .brands-info { height: 100%; overflow-y: auto; box-sizing: border-box; } 

(box-sizing: border-boxis not relevant in this partiular case, but you'll need it if you add any margin or padding in order to keep the 100% height (in relation to the parent element)

Sign up to request clarification or add additional context in comments.

2 Comments

I´m trying, now I can do scroll just in this div, but I don´t know, I can´t do it to the bottom of my div with scroll (brand-info), I´m lookign for a parent div with some limit... but I´m not sure...
Yeah, I forgot the height. Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.