本文介绍了在一行中滚动div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一行滚动div中的文本,适合两个div。








已修改以预设页脚中的所有div必须并排! b
$ b



记录,此解决方案使用Jquery实时收集每个div的宽度和总和,以设置页脚div。没有它,它不能做!






已编辑,以使所有3个div并排包装器宽度


I need to have the text in a One-Line scrolling div, fitting inside both divs.

http://jsfiddle.net/F6pNm/26/

The goal is for all to fit on one line!

EDIT: I guess I wasn't specific enough, I need the links and the text to fit on the same line. This way, the scrolling is vertically.

EDIT: This is now the closest to what I need. Only the scrolling aspect is missing. http://jsfiddle.net/BKvzV/4/

解决方案

If I read you correctly, you don't what your text to break, but to keep on going never leaving the line #1, so you can use CSS like this:

Fiddle Example!

YOUR CSS UPDATED

#flash {
    float:left;
    width: auto;
    font-size: small;
    font-style: italic;
    text-align: center;
    white-space:nowrap;
}

The difference is the white-space:nowrap;

For does who can't see it:


EDITED to contemplate the edited question issue!

The new Fiddle!


EDITED to contemplate the fact that all divs inside the footer must be side by side!

The updated Fiddle!

Take note that this solution uses Jquery to collect in real time the width of each div and sum all together to set the footer div. Without it, it can't be done!


EDITED to have all 3 divs side by side within the wrapper width

in the Fiddle example, the wrapper is the body

The new Fiddle!

这篇关于在一行中滚动div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 16:19