I want the div that’s on the right side to match the height of the div that’s on the left. The div on the right should always be the same height as the div on the left. The div on the left auto adjust its height. I want both divs to always have the same height. A picture is worth a thousand words so please take a look at the picture below.
The jsfiddle code indicates that you need to learn to write basic HTML. There are simply too many tags missing or mismatched throughout and others that are incorrectly located. Basic HTML is a prerequisite to creating a working web page.
I recommend that you invest a few minutes in yourself and at least read an HTML primer.
You can search the forum for something like “equal height columns” and find some copy-n-paste code that will probably work, IF you understand how to correctly substitute your code into it.
Ronpat is right. Structure is CRUCIAL when coding.
Also “equal height” is not natural in CSS, you kind of have to fake it ( and be aware of the limitations of faking it). 4 basic ways of achieving columns:
If you know the widths of the columns. A then have have a container with vertically repeating bg image
You could also nest containers and use margins to position the content columns , tho that’s adding a lot of wrappers for presentation only.
If your columns are a solid color, and you need 3 or less, and your left and right columns are some fixed value ( not %) , you can use border-left/right on the container as the bg color , then use negative margins to position the side columns. over the container’s border.
in this case .cont would indicate a row of columns. You can adjust the width of each column (%,em, px, etc. ) by targeting a separate rule ( .left, .right, . center… do note that with display:table; you aren’t limited to 3 cols)
The following code uses the table/table-cell method to construct equal height columns. I chose this because it is the easiest. The page should render similarly to your intent. I did not do anything with the </a> because there was no opening tag.
This is not a great example, but it is valid and works back to IE8.
You seriously need to reconsider the importance of HTML on your pages. CSS can overcome some crummy HTML but cannot be guaranteed to do so consistently across all browsers. The only thing that works best cross-browser is valid code. That’s just the way it is. The kicker is that, as dresden_phoenix said, the structure of the HTML has to be viable. One can write perfectly valid code that will not render a useful page. They go hand-in-hand with effective CSS to produce quality pages.