jquery - Image and label not aligning correct -
i trying align text of label starts @ same indent text in first line when text spills on next line due insufficent screen space. created example demonstrate problem im having.
alignment should this
http://jsfiddle.net/74k8kptc/2/
<body> <div class="container"> <div class="toggle_head"> <img src="pfeil_rechts_blau.png" alt="expand" class="expand"> <img src="pfeil_links_blau.png" alt="collapse" class="collapse"> <label class="question">some long text doesnt align when page forces text on new line on making smaller</label> </div> <div class="toggle_body"> <hr> lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. @ vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet. lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. @ vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet. </div> </div>
.toggle_body { padding-left: 15px; font-size:12; display: none; } .container { padding-bottom: 8px; } .expand { height: 8px; } .collapse { height: 8px; } .question { font-weight: bold; padding-left: 5px; }
$(".toggle_body").hide(); $(".collapse").hide(); $(".toggle_head").click(function () { var $this = $(this); $this.next(".toggle_body").slidetoggle(500, function () { $this.children('img').toggle(); }); });
.toggle_body { padding-left: 15px; font-size:12; display: none; } .toggle_head { display: table; } .container { padding-bottom: 8px; } .expand { height: 8px; } .collapse { height: 8px; } .question { font-weight: bold; display: table-cell; padding-left: 5px; vertical-align: top; } img{ vertical-align: top; display: table-cell; }
Comments
Post a Comment