I have a CSS problem that I'm not able to figure out. I'm not even sure it is possible. What I want is the following:
I have three buttons/tabs like this http://sv.tinypic.com/r/21cf85t/6 and when you click one tab a different div should show for each tab like this http://sv.tinypic.com/r/21l5y85/6 or http://sv.tinypic.com/r/2dbrv5u/6.
I know how to show/hide the divs with jQuery but the problem is that the divs will increase in height http://sv.tinypic.com/r/k2xxfb/6 and then they will push the other tabs and divs down. Is there a way to create what I am trying to do?
I'm not a guru in CSS so if you have an example to look at or can post code here I would be very very thankful!
This is the HTML I'm using for my tabs:
<div class="MainContent">Content</div> <div class="TabsHolder"> <div id="Tab1"> <div style="width:200px"> Content Tab 1 </div> </div> <a class="Button1" href="#Tab1"></a> <div class="clearer"></div> <div id="Tab2"> <div style="width:200px"> Content Tab 2 </div> </div> <a class="Button2" href="#Tab2"></a> </div> CSS:
.MainContent { float: left; } .TabsHolder { float: left; } .Button1 { float: left; margin: 100px 0px 20px 0px; background: url(images/Button1.png) no-repeat 0 0; height: 79px; width: 27px; } #Tab1 { width: 200px; margin: 80px 0px 20px 0px; border: solid 1px #ACCD45; position: relative; float: left; overflow: hidden; padding: 20px; } .Button2 { float: left; margin: 0px 0px 20px 0px; background: url(images/Button2.png) no-repeat 0 0; height: 97px; width: 27px; } #Tab2 { width: 200px; margin: 0px 0px 20px 0px; border: solid 1px #ACCD45; position: relative; float: left; overflow: hidden; padding: 20px; } div.clearer { clear: both; margin: 0px; margin-bottom: 0px; margin-top: 0px; padding: 0px; line-height: 0px; height: 0px; width: 0px; overflow: hidden; }