html - CSS problem, creating tabs -


I have a CSS problem that I can not understand. I'm not even sure that this is possible. What I want is the following:

I have three buttons like this / tabs and when you click on a tab, this way, each tab should show a separate device or

< P> I know how to show / hide divs with jQuery but the problem is that the divs will increase in height and then they will press the other tabs and divs down what am I trying to do?

I am not a guru in CSS, if you can see the code here or post here, I would be very grateful!

This is the HTML I am using for my tab:

  & lt; Div class = "maincontent" & gt; Content & lt; / Div & gt; & Lt; Div class = "TabsHolder" & gt; & Lt; Div id = "Tab1" & gt; & Lt; Div style = "width: 200px" & gt; Content tab 1 & lt; / Div & gt; & Lt; / Div & gt; & Lt; One class = "button1" href = "# tab1" & gt; & Lt; / A & gt; & Lt; Div class = "clear" & gt; & Lt; / Div & gt; & Lt; Div id = "tab2" & gt; & Lt; Div style = "width: 200px" & gt; Content tab 2 & lt; / Div & gt; & Lt; / Div & gt; & Lt; One class = "button2" href = "# tab2" & gt; & Lt; / A & gt; & Lt; / Div & gt;  

CSS:

  .main content {float: left; }. Tabsholder {float: left; }. Button 1 {float: left; Margin: 100px 0px 20px 0px; Background: URL (Images / Button 1) no revival 0 0; Height: 79 pixels; Width: 27px; } # Tab1 {width: 200px; Margin: 80px 0 px 20px px; Border: Solid 1px # ACCD45; Status: Relative; Swim left; Hidden flurry; Padding: 20px; }. Button 2 {float: left; Margin: 0 px 0 px 20 px 0 px; Background: URL (images / button 2) no-repeat 0; Height: 97px; Width: 27px; } # Tab2 {width: 200px; Margin: 0 px 0 px 20 px 0 px; Border: Solid 1px # ACCD45; Status: Relative; Swim left; Hidden flurry; Padding: 20px; } Div.clearer {Clear: Both; Margin: 0 px; Margin-down: 0 pixels; Margin-top: 0 pixels; Padding: 0 pixels; Line-height: 0 pixels; Height: 0 pixels; Width: 0 pixels; Hidden flurry; } Here I am using pure CSS - Firefox, Try IE8 and Chrome (not sure about others)  

Note: I wanted to make a comment about one thing in my basic HTML - you can call & lt; A & gt; Can not add a background image to tag

CSS

  .mientent {float: left; Width: 400px; Height: 400 pixels; Background: # 444; } .buttons {float: left; Margin: 10px 0 10px 0; Width: 27px; Clean both; }. Button 1 {Background: # 555 Url (Images / Button 1 page) No-Encore 0 0; Height: 79 pixels; }. Button 2 {Background: # 555 Url (Image / Button 2) No-repeat 0; Height: 97px; }. Button 3 {Background: # 555 URL (images / button 3) repeat any 0 0; Height: 127px; } .tabsHolder {float: left; Status: Relative; }. Tabs {width: 200px; Height: 200 pixels; Margin: 0 20 px 0; Border: Solid 1px # ACCD45; Background: # 444; Hidden flurry; Padding: 20px; display none; Status: Completed; Left: 0; } # Tab 1 {top: 0; } # Tab 2 {top: 98px; } # Tab3 {top: 215px; } A: Hover. Tabs {display: block;}  

HTML

  & lt; Div class = "maincontent" & gt; Content & lt; / Div & gt; & Lt; Div class = "tabholder" & gt; & Lt; A href = "# tab1" & gt; & Lt; Div class = "button button 1" & gt; 1 & lt; / Div & gt; & Lt; Div id = "tab1" class = "tab" & gt; Content tab 1 & lt; / Div & gt; & Lt; / A & gt; & Lt; A href = "# tab2" & gt; & Lt; Div class = "button button 2" & gt; 2 & lt; / Div & gt; & Lt; Div id = "tab2" square = "tab" & gt; Content tab 2 & lt; / Div & gt; & Lt; / A & gt; & Lt; A href = "# tab3" & gt; & Lt; Div class = "button button 3" & gt; 3 & lt; / Div & gt; & Lt; Div id = "tab3" class = "tab" & gt; Content tab 3 & lt; / Div & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -