Template:Flowlist/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 31: Line 31:


== Examples ==
== Examples ==
<pre>
{{Pre|
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{!(n(}}{{fcb|#4169e1|File}}:{{fcb|#2e8b57|Books.png}}|left|thumb|100px|Animal Books]] List of animals:
{{flowlist|
{{((}}{{fcb|#4169e1|flowlist}}|
* [[cat]]
* {{!(n(}}{{fcb|#2e8b57|cat}}]]
* [[dog]]
* {{!(n(}}{{fcb|#2e8b57|dog}}]]
* [[horse]]
* {{!(n(}}{{fcb|#2e8b57|horse}}]]
* [[cow]]
* {{!(n(}}{{fcb|#2e8b57|cow}}]]
* [[sheep]]
* {{!(n(}}{{fcb|#2e8b57|sheep}}]]
* [[pig]]
* {{!(n(}}{{fcb|#2e8b57|pig}}]]
{{))}}
}}
}}
</pre>


[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
Line 55: Line 55:


;Alternative syntax:
;Alternative syntax:
<pre>
{{Pre|
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{!(n(}}{{fcb|#4169e1|File}}:{{fcb|#2e8b57|Books.png}}|left|thumb|100px|Animal Books]] List of animals:
{{flowlist}}
{{((}}{{fcb|#4169e1|flowlist}}{{))}}
* [[cat]]
* {{!(n(}}{{fcb|#2e8b57|cat}}]]
* [[dog]]
* {{!(n(}}{{fcb|#2e8b57|dog}}]]
* [[horse]]
* {{!(n(}}{{fcb|#2e8b57|horse}}]]
* [[cow]]
* {{!(n(}}{{fcb|#2e8b57|cow}}]]
* [[sheep]]
* {{!(n(}}{{fcb|#2e8b57|sheep}}]]
* [[pig]]
* {{!(n(}}{{fcb|#2e8b57|pig}}]]
{{endflowlist}}
{{((}}{{fcb|#4169e1|endflowlist}}{{))}}
</pre>
}}


[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:

Revision as of 20:00, 17 June 2023

Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.


Usage

If you have this problem of list bullets and numbers overlapping with a left floating image or Infobox, for example:

Animal Books

List of animals:

then {{Flowlist}} enables lists to stay clear of these left floating objects. It effectively makes lists act as a block level element. It does however have a few side effects that you should take note of.

Animal Books

List of animals:

This template can be used with or without {{endflowlist}}.

Examples

[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{flowlist|
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
}}
Animal Books

List of animals:

Alternative syntax
[[File:Books.png|left|thumb|100px|Animal Books]] List of animals:
{{flowlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
{{endflowlist}}
Animal Books

List of animals:

Parameters

  • |class= – adds a CSS class to the containing div.
  • |style= – adds CSS style options.

Side effects

Using this technique has a side effect. If your list is longer than the floated element, then the list will not flow around the image like normal, but instead be one block, leaving white space below the floated element. This goes for both left and right side of the list.

This

Animal Books
Animal Books
List of animals:
  • cat in a very long sentence that should collide with the image to the right
  • dog in a very long sentence that should collide with the image to the right

Will become

Animal Books
Animal Books
List of animals:
  • cat in a very long sentence that should collide with the image to the right
  • dog in a very long sentence that should collide with the image to the right

See Also

TemplateData

Create a list around left floating objects, like images and infoboxes.

Template parameters

ParameterDescriptionTypeStatus
Classclass

CSS class to containing <div> tag

Unknownoptional
Stylestyle

CSS style

Unknownoptional