开发者

how to include 5 <BR>'s in Haml?

开发者 https://www.devze.com 2023-01-20 09:00 出处:网络
this code 开发者_StackOverflow中文版= 5.times {|n| puts \"<BR>\"} does nothing for me ...- 5.times do

this code

开发者_StackOverflow中文版
= 5.times {|n| puts "<BR>"}

does nothing for me ...


- 5.times do
  %br


Another way:

= "<br/>"*5


You can use % to specifically add a tag. So, for 5
do

%br/
%br/
%br/
%br/
%br/

But: why would you want to do this? It would probably be a better idea to use a %div and set the spacing in CSS rather than multiple BR tags.


You can also insert regular html.

Like this:

%p
  Headline
  <br><br><br><br><br>
  Paragraph goes here, blah blah blah...

Or like that:

:plain
  <br><br><br><br><br>
0

精彩评论

暂无评论...
验证码 换一张
取 消