简体   繁体   English

输入滑块的样式问题

[英]Styling issues with a input slider

Trying to get my outputs to show up in line with the words explaining them, right now, they are being shunted to the next line, which I dont want. 为了使我的输出与解释它们的单词一致,现在,它们正被转移到下一行,这是我所不希望的。

Taco Stands:    Cost per <b><output class="output6">0</output></b> tacos<br>
TacoTaco <output class="output1">0</output>
Los Hermanos Tacos <output class="output2">0</output>
Natcho Taco<output class="output3">0</output>
Taco Bell<output class="output4">0</output>
Chipolte<output class="output5">0</output>

https://jsfiddle.net/xnpqd8cs/ https://jsfiddle.net/xnpqd8cs/

I also cant seem to figure out how to have the output numbers have commas for better readability. 我似乎也无法弄清楚如何使输出数字带有逗号以提高可读性。

Wrap every line with output in a div and remove the display: block; 在div中将每行与输出一起包装,然后移除display: block; from the outputs. 从输出。 You should have a block container for each row containing the text and the output to be separated like you want it. 对于每一行,您都应该有一个块容器,其中包含要按需分隔的文本和输出。

<div>Taco Stands:    Cost per <b><output class="output6">0</output></b> tacos</div>
<div>TacoTaco <output class="output1">0</output></div>
<div>Los Hermanos Tacos <output class="output2">0</output></div>
<div>Natcho Taco<output class="output3">0</output></div>
<div>Taco Bell<output class="output4">0</output></div>
<div>Chipolte<output class="output5">0</output></div>

It is because of output { display: block; } 这是因为output { display: block; } output { display: block; }
Block will display the elements as the separate line. 块将元素显示为单独的行。 Either remove this or use output { display: inline; } 要么删除它,要么使用output { display: inline; } output { display: inline; } :) output { display: inline; } :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM