Hallo alle zusammen,
ich habe ein kleines Problem bei einem Akkordeon, welches ich mit HTML, CSS gebaut habe. Das Akkordeon wird für eine Frage-Antwort Seite verwendet.
Da der Content ziemlich klein ist und die Texte unterschiedlich lang habe ich Platzprobleme mit "min-height".
Ich möchte für die Antworten nun immer eine eigene Höhe angeben um so Platz zu sparen.
Frage ist wie?
Habe schon einiges ausprobiert, aber elider funktioniert es nicht so wie ich es will. :(
Ich bedanke mich schomal im vorraus.
HTML:
<div class="accordionMenu">
<div id="frage1" class="menuSection">
<h2><a href="#frage1">...</a></h2>
<p>... </p>
</div>
<div id="frage2" class="menuSection">
<h2><a href="#frage2">...</a></h2>
<p>Ganz...</p>
</div>
<div id="frage3" class="menuSection">
<h2><a href="#frage3">...</a></h2>
<p>....</p>
</div>
<div id="frage4" class="menuSection">
<h2><a href="#frage4">...</a></h2>
<p>...</p>
</div>
<div id="frage5" class="menuSection">
<h2><a href="#frage5">...</a></h2>
<p>...</p>
</div>
<div id="frage6" class="menuSection">
<h2><a href="#frage6">...</a></h2>
<p id="frage6">...</p>
</div>
</div>
CSS:
.accordionMenu {
padding: 0px;
width: 500px;
font: 13px 'Source Sans Pro', sans-serif;
background: #fff;
}
.accordionMenu h2 {
margin:5px 0;
padding:0;
}
.accordionMenu h2 a {
font-size: 14px;
display: block;
font-weight: normal;
color:#fff;
text-decoration:none;
margin:0;
padding:3px;
padding-left:5px;
background: #b90529;
}
.accordionMenu :target h2 a {
font-weight:bold;
}
.accordionMenu h2 a:hover,
.accordionMenu h2 a:focus,
.accordionMenu h2 a:active {
font-weight:bold;
}
.accordionMenu p {
padding:0px;
padding-bottom:0px;
margin:0;
height: 0;
overflow: hidden;
-moz-transition: height 0.3s ease-in;
-webkit-transition: height 0.3s ease-in;
-o-transition: height 0.3s ease-in;
transition: height 0.3s ease-in;
}
.accordionMenu :target p {
overflow: auto;
min-height:120px;
padding: 0px;
}
ich habe ein kleines Problem bei einem Akkordeon, welches ich mit HTML, CSS gebaut habe. Das Akkordeon wird für eine Frage-Antwort Seite verwendet.
Da der Content ziemlich klein ist und die Texte unterschiedlich lang habe ich Platzprobleme mit "min-height".
Ich möchte für die Antworten nun immer eine eigene Höhe angeben um so Platz zu sparen.
Frage ist wie?
Habe schon einiges ausprobiert, aber elider funktioniert es nicht so wie ich es will. :(
Ich bedanke mich schomal im vorraus.
HTML:
<div class="accordionMenu">
<div id="frage1" class="menuSection">
<h2><a href="#frage1">...</a></h2>
<p>... </p>
</div>
<div id="frage2" class="menuSection">
<h2><a href="#frage2">...</a></h2>
<p>Ganz...</p>
</div>
<div id="frage3" class="menuSection">
<h2><a href="#frage3">...</a></h2>
<p>....</p>
</div>
<div id="frage4" class="menuSection">
<h2><a href="#frage4">...</a></h2>
<p>...</p>
</div>
<div id="frage5" class="menuSection">
<h2><a href="#frage5">...</a></h2>
<p>...</p>
</div>
<div id="frage6" class="menuSection">
<h2><a href="#frage6">...</a></h2>
<p id="frage6">...</p>
</div>
</div>
CSS:
.accordionMenu {
padding: 0px;
width: 500px;
font: 13px 'Source Sans Pro', sans-serif;
background: #fff;
}
.accordionMenu h2 {
margin:5px 0;
padding:0;
}
.accordionMenu h2 a {
font-size: 14px;
display: block;
font-weight: normal;
color:#fff;
text-decoration:none;
margin:0;
padding:3px;
padding-left:5px;
background: #b90529;
}
.accordionMenu :target h2 a {
font-weight:bold;
}
.accordionMenu h2 a:hover,
.accordionMenu h2 a:focus,
.accordionMenu h2 a:active {
font-weight:bold;
}
.accordionMenu p {
padding:0px;
padding-bottom:0px;
margin:0;
height: 0;
overflow: hidden;
-moz-transition: height 0.3s ease-in;
-webkit-transition: height 0.3s ease-in;
-o-transition: height 0.3s ease-in;
transition: height 0.3s ease-in;
}
.accordionMenu :target p {
overflow: auto;
min-height:120px;
padding: 0px;
}