请看这里的jsfiddle
如何让图片、内容、金额显示在同一行
如果你看到图片 150 必须显示在同一行。
var HTML = $('<div class="cart" id="mee"></div>');
var test = $("#imagesd").attr('src');
var id_attr = $(this).attr("id");
HTML.append('<input id_attr="'+id_attr+'" type="checkbox" checked id= "newer" class="newer item_chk" name="item_check" value="'+$(this).attr('value')+'"/>'+$(this).attr('value')) ;
HTML.append('<img type="img" height="40" width="40" src="'+imagesrdd+'"/>') ;
HTML.append('<div id_attr="'+id_attr+'">'+amountdd+'</div>');
请看这里的图片
最佳答案
如果你想让它们显示在一行中,那么你需要使用一些内联元素或者只是将它们设置为内联显示。
您正在为 + 和 - 按钮使用 DIV 元素,要么为它们使用 SPAN,要么为它们设置样式 'display: inline-block;'
.buttontest {
display: inline-block;
margin: 0 10px;
}
更新 fiddle :http://jsfiddle.net/HE7yT/2/
关于html - 我怎样才能让div出现在同一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23857854/