Home » Web Development » CSS, Web Development » CSS – min-height attribute

CSS – min-height attribute

I’ve been working with CSS for a while on my websites but one thing always plagued me; I couldn’t get the height of my page to scale with my content automatically. I always had to write a separate ID selector for each page set to a fixed height. I don’t know why I never just google’d it, but for some reason, 6 websites later, I did. It wasn’t rocket science, it was a simple

    #container {min-height:###px;}.

Once I set the min-height, no matter how much content I added, it scaled to fit. Presto! Problem solved and lots of time saved. Make sure that any content you put in here is set to position: relative; not absolute. If it’s absolute, then the container won’t scale.
 

 

CSS, Web Development , , ,

No Comments to “CSS – min-height attribute”

Leave a Reply

(required)

(required)