拉伸/压缩星号线 [英] Stretching/compressing line of asterisks

查看:57
本文介绍了拉伸/压缩星号线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想在段落之间添加几行星号,并且

它会拉伸空格,使其跨越文本宽度的100%,如下所示:


* * * * * * * *


有没有办法在CSS中执行此操作?如果窗口变窄,我不想让它换线,只需要折叠。


-

---------------------------------------------- ------------------------------

Kim Scarborough http://www.unknown.nu/kim/

------- -------------------------------------------------- -------------------

那些''abjure''暴力的人只能这样做,因为其他人正在犯罪

代表他们的暴力行为。

- George Orwell

-------------------- -------------------------------------------------- ------

解决方案

Kim Scarborough< sl **** @ unknown.nu>写道:

说我想在段落之间放几行星号,
并让它拉伸空格,使其跨越100%的
文本-width, - -
有没有办法在CSS中做到这一点?




我不这么认为。您可以使用字母间距或

字间距属性来影响间距,但它们会使用长度值。我看不出

我们如何指定它们以使宽度为100%。


但我会建议一些不同的方法。看来你希望

使用装饰分隔线。有许多方法,包括非CSS使用图像和各种CSS技术,参见例如
http://ppewww.ph.gla.ac.uk/~flavell/www/hrstyle.html
http://www.cs.tut.fi /〜jkorpela/html/alt.html#hr


具体来说,如果您的文档内容有一行星号分隔

的空格,基于语音的用户代理会说些奇怪的话 - 除非他们足够聪明地说出由空格分隔的二十个星号,

我加倍。使用图像(通过< img>)或背景图像

可以避免这个问题。


-

Yucca , http://www.cs.tut.fi/~jkorpela/


>具体来说,如果您的文档内容中有一行星号用空格分隔

,基于语音的用户代理会说一些奇怪的东西 - 除非他们足够聪明地说二十个星号分隔空间,
我怀疑。使用图像(通过< img>)或背景图像
可以避免这个问题。




嗯,这个出现的唯一原因是因为我正在努力做一个相当忠实的XHTML版本的爱丽丝梦游仙境(因为各种原因因为网络上的版本而感到不满)。 Carroll

使用星号行来表示不同点的转换,给定版本的

排版器将设置要填充的星号数

他们正在使用的任何列长度。我想也许我可以做这样的事情作为一个合理的等价物:


SPAN.stretch {text -align:justify; width:100%}

....

< span class =" stretch"> * * * * *< / span> ;


但显然,这并不像我预期的那样有效。


我想我可以拍一张星号图片,但它就不会迟到匹配字体

然后。可能我只会做一个居中的< pre>阻止而不用担心

延伸。


-

----------- -------------------------------------------------- ---------------

Kim Scarborough http://www.unknown.nu/kim/

---------------------- -------------------------------------------------- ----

那些放弃暴力的人只能这样做,因为其他人代表他们犯下了暴力行为。

- George Orwell

----------------------------------- -----------------------------------------


> Kim,如果你喜欢我的话,你可以使用它:


http://www.bookstacks.org/carroll/alice/chapters.html




谢谢,但是.. 。书的用途是什么......没有图片?


-

----------- -------------------------------------------------- ---------------

Kim Scarborough http://www.unknown.nu/kim/

---------------------- -------------------------------------------------- ----

那些放弃暴力的人只能这样做,因为其他人代表他们犯下了暴力行为。

- George Orwell

----------------------------------- -----------------------------------------


Say I wanted to put a couple lines of asterisks between paragraphs, and have
it stretch the spaces so that it spanned 100% of the text-width, like this:

* * * * * * * *

Is there a way to do this in CSS? I don''t want it to line break, just collapse
the spacing between the stars if the window gets narrower.

--
----------------------------------------------------------------------------
Kim Scarborough http://www.unknown.nu/kim/
----------------------------------------------------------------------------
"Those who ''abjure'' violence can only do so because others are committing
violence on their behalf."
-- George Orwell
----------------------------------------------------------------------------

解决方案

Kim Scarborough <sl****@unknown.nu> wrote:

Say I wanted to put a couple lines of asterisks between paragraphs,
and have it stretch the spaces so that it spanned 100% of the
text-width, - -
Is there a way to do this in CSS?



I don''t think so. You could affect the spacing using letter-spacing or
word-spacing properties, but they take length values. I can''t see how
we could specify them so that the width is 100%.

But I would suggest some different approach. It seems that you wish to
use decorative divider. There are many approaches, including non-CSS
use of images and various CSS techniques, see e.g.
http://ppewww.ph.gla.ac.uk/~flavell/www/hrstyle.html
http://www.cs.tut.fi/~jkorpela/html/alt.html#hr

Specifically, if your document content has a row of asterisks separated
by spaces, speech-based user agents will say something odd - unless
they are clever enough to say "twenty asterisks separated by spaces",
which I double. Using either an image (via <img>) or a background image
avoids this problem.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


> Specifically, if your document content has a row of asterisks separated

by spaces, speech-based user agents will say something odd - unless
they are clever enough to say "twenty asterisks separated by spaces",
which I doubt. Using either an image (via <img>) or a background image
avoids this problem.



Well, the only reason this is coming up is because I''m trying to do a
reasonably faithful XHTML version of Alice''s Adventures in Wonderland (being
displeased for various reasons with the versions currently on the web. Carroll
used rows of asterisks to indicate transitions at various points, and the
typesetters of a given edition will set the number of asterisks to fill
whatever column length they''re using. I thought that maybe I could do
something like this as a reasonable equivalent:

SPAN.stretch {text-align: justify; width: 100%}
....
<span class="stretch">* * * * *</span>

But obviously, that doesn''t work as I intended.

I suppose I could do a picture of asterisks, but it wouldn''t match the font
then. Probably I''ll just do a centered <pre> block and not worry about it
stretching out.

--
----------------------------------------------------------------------------
Kim Scarborough http://www.unknown.nu/kim/
----------------------------------------------------------------------------
"Those who ''abjure'' violence can only do so because others are committing
violence on their behalf."
-- George Orwell
----------------------------------------------------------------------------


> Kim, if you like mine, you can use it:


http://www.bookstacks.org/carroll/alice/chapters.html



Thanks, but... "what is the use of a book... without pictures"?

--
----------------------------------------------------------------------------
Kim Scarborough http://www.unknown.nu/kim/
----------------------------------------------------------------------------
"Those who ''abjure'' violence can only do so because others are committing
violence on their behalf."
-- George Orwell
----------------------------------------------------------------------------


这篇关于拉伸/压缩星号线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆