টেমপ্লেট:Block center/নথি
এটি টেমপ্লেট:Block center-এর জন্য একটি নথির উপপাতা। এখানে ব্যবহার সংক্রান্ত তথ্য, বিষয়শ্রেণী এবং অন্যান্য সামগ্রী রয়েছে যা মূল টেমপ্লেট পাতার অংশ নয়। |
এই টেমপ্লেটটি টেমপ্লেট শৈলী ব্যবহার করে: |
This template uses block (e.g. <div> or <p> ) elements.It should not be nested inside an inline element (e.g. |
Usage
[সম্পাদনা]This template places a block of text in the center of the page, without affecting the text alignment within that block.
{{bc}} is a shorter form of this template that redirects here.
- Comparison of {{Block center}} and {{Center}}
This template retains the current text alignment (usually left), but moves the entire block of text into the center. To change to centred text alignment, use {{Center}} instead.
- Block center
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.
Aenean massa.
- Center
Aenean commodo ligula eget dolor.
Aenean massa.
Parameters
[সম্পাদনা]All parameters are optional.
- title: Title of the block (optional)
- width: the width of the block
- max-width: the maximum width of the block. Optional: default 100%.
- align: the text alignment within the block. One of
left
,right
,center
,justify
, default is unspecified and so inherits from the parent. - class: additional CSS classes, which can be used in conjunction with Help:Page styles CSS. The classes
wst-block-center
andwst-block-center-title
are always applied to the block and to the title respectively. - style: additional CSS styles (prefer a class if the style is re-used within a work)
title
[সম্পাদনা]Where there is a need to give the title of the work, an optional "title" parameter can be used. Sometimes this is will center the title better than a stand-alone line will; other times not - it usually depends on if a fixed width (next example) is forced or not.
{{block center|title=LOREM IPSUM|Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br/> Aenean commodo ligula eget dolor. Aenean massa.}}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.
Aenean massa.
width
[সম্পাদনা]Where there is a requirement to fix the width of the block, an optional "width" parameter can be used. Sometimes this is required to force a wider width when line wrap occurs.
{{block center|width=25em|Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br/> Aenean commodo ligula eget dolor. Aenean massa.}}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.
Aenean massa.
Note: this will force the width even when the page is narrower than the given width, up to the maximum specified by max-width, or 100% if that's not given.
Note: generally, avoid using percentages, as this will probably be unreasonably narrow on small screens. If the content is text, prefer text-relative CSS units, such as em. See H:PXWIDTH for more details.
max-width
[সম্পাদনা]This parameter provides a maximum width for the block, such that no matter how wide the parent container, the centred block will be no wider than this. Very often, this is a better choice than width, because it allows content to shrink on smaller screens like e-readers.
{{block center|max-width=15em|Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna }}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
However, if the parent container is smaller that this value, the block will shrink as normal:
<div style="width:10em; margin:auto;"> {{block center|max-width=15em| Lorem ipsum dolor sit amet, consectetur adipisicing elit }} </div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit
The two parameters can be combined. In this case, the width will be set according to the width parameter on small screens (below the max-width value), and then will be limited to the max-width value on large screens. Note that the width value has to change according to the parent size, so it's normally a percentage value (often 100%).
This is useful when there are floated blocks that don't cause the block to expand to the correct width, but where it's still desirable for the block to shrink on smaller screens:
<div style="width:100%; border:1px dashed green;"> {{block center|max-width=40em|width=100% |Wide parent: max-width of 40em applies.{{-}}{{float right|''Text on the right.''}} }} </div>
Wide parent: max-width of 40em applies.
Text on the right.
<div style="width:30em; margin:auto; border:1px dashed green;"> {{block center|max-width=40em|width=100% |Narrow parent: 100% width{{-}}{{float right|''Text on the right.''}} }} </div>
Narrow parent: 100% width
No overflow of parent.
style
[সম্পাদনা]Where there is a need to specify the style of the text, an optional "style" parameter can be used. This parameter takes the same style attributes that can be set for any table.
{{block center|style=font-style:italic|<poem> Lorem ipsum dolor sit amet, {{gap}}consectetuer adipiscing elit. Aenean commodo ligula eget dolor; {{gap}}Aenean massa. </poem>}}
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.
Aenean commodo ligula eget dolor;
Aenean massa.
align
[সম্পাদনা]The text alignment within the (overall) centered block may be controlled using this (default: left):
{{block center|align=right|<poem> Lorem ipsum dolor sit amet, {{gap}}consectetuer adipiscing elit. Aenean commodo ligula eget dolor; {{gap}}Aenean massa. </poem>}}
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.
Aenean commodo ligula eget dolor;
Aenean massa.
Spanning multiple pages
[সম্পাদনা]If you use many separate block centers you will find that every page has a slightly different alignment, however this template cannot be left "dangling" and closed on another page to create one big block center. If you have a multipage block center, you can use {{block center/s}} and {{block center/e}} to open and close it on each page. Every page must have one of each, one at the start and one at the end. However, you may place one or both of them in the header or footer, so they will not be transcluded to the main namespace. When the pages are all transcluded, you will end up with just one {{block center/s}} and just one {{block center/e}} at the start and end of the section, respectively.
First page
[সম্পাদনা]- Header
Nothing is required in the header
- Body
{{block center/s}} Start of the block center text. Contents of the block center goes here.
- Footer
{{block center/e}}
Middle pages
[সম্পাদনা]- Header
{{block center/s}}
- Body
Contents of the block center go here; this continues the previous page.
- Footer
{{block center/e}}
Last page
[সম্পাদনা]- Header
{{block center/s}}
- Body
Contents of the block center go here; this continues the previous page. Last bit of block center text {{block center/e}}
- Footer
Nothing is required in the footer of the last page.
See also
[সম্পাদনা]- {{Center block}}
বিবরণ নেই।
প্যারামিটার | বিবরণ | ধরন | অবস্থা | |
---|---|---|---|---|
class | class | additional CSS classes, which can be used in conjunction with Help:Page styles CSS. The classes wst-block-center and wst-block-center-title are always applied to the block and to the title respectively. | বিষয়বস্তু | ঐচ্ছিক |
width | width | The width of the block (needs units which are valid CSS units.) | বিষয়বস্তু | পরামর্শকৃত |
talign | talign align | the text alignment within the block. One of left, right, center, justify, default is unspecified and so inherits from the parent.
| অজানা | পরামর্শকৃত |
max-width | max-width | বিবরণ নেই | অজানা | ঐচ্ছিক |
style | style | Additional CSS styles (prefer a class if the style is re-used within a work) | বিষয়বস্তু | ঐচ্ছিক |
title | title | Title of the block | বিষয়বস্তু | ঐচ্ছিক |
body | body 1 | The text to be placed centrally as a block | বিষয়বস্তু | ঐচ্ছিক |