• When posting, please be aware that artistic nudity is still nudity and not allowed under RpNation rules. Please edit your pictures accordingly!

    Remember to credit artists when using work not your own.

Help A code for center block

bigdiglets

New Member
I have read the tutorials on it here and have tried it but I'm having major difficulties. I've also spend hours looking through the bbcode center to get an understanding but I'm just missing info on the how to. I know nothing about coding, but I want to make my posts readable on mobile. Can someone make a code for me that has the text centered in the middle but in a block, not all the way across the screen? Please?
 

Serobliss

「休 息」
Helper
Are you asking for this?

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a erat ante. Donec ac consectetur lacus, in laoreet est. Suspendisse vehicula eu est quis pellentesque. Sed scelerisque augue nec consequat vestibulum. Fusce dui metus, tristique interdum malesuada at, posuere nec lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Pellentesque a orci non lorem rutrum sollicitudin. Duis ut lacinia augue. Aliquam in ipsum mollis, ultricies erat a, faucibus massa. Aenean nulla ante, sagittis vel congue volutpat, hendrerit id libero. Suspendisse ornare facilisis congue. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras fringilla sapien at augue malesuada venenatis. Aenean condimentum bibendum pharetra.

Etiam quam dolor, vehicula vel velit non, feugiat commodo lectus. Praesent convallis dui nec porttitor cursus. In pulvinar, lorem eu efficitur ullamcorper, risus eros ullamcorper quam, a congue velit lectus non nibh. Sed a tortor quis libero gravida tristique. Sed non dignissim risus. Sed et ipsum mollis, semper ligula sodales, mollis risus. Praesent neque elit, congue a blandit quis, tincidunt non nibh. Pellentesque a velit non quam finibus tincidunt id in nunc. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec sed ipsum vitae elit mollis varius. Mauris at varius nibh. Aliquam feugiat eget dolor at rhoncus. Nulla pharetra sem vitae ipsum tincidunt, non condimentum ante ultricies. Proin pellentesque pellentesque lectus nec congue.


Code:
[border=1px solid red; text-align: center; box-sizing: border-box; width: clamp(250px, 100%, 600px); margin: 0 auto]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a erat ante. Donec ac consectetur lacus, in laoreet est. Suspendisse vehicula eu est quis pellentesque. Sed scelerisque augue nec consequat vestibulum. Fusce dui metus, tristique interdum malesuada at, posuere nec lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Pellentesque a orci non lorem rutrum sollicitudin. Duis ut lacinia augue. Aliquam in ipsum mollis, ultricies erat a, faucibus massa. Aenean nulla ante, sagittis vel congue volutpat, hendrerit id libero. Suspendisse ornare facilisis congue. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras fringilla sapien at augue malesuada venenatis. Aenean condimentum bibendum pharetra.

Etiam quam dolor, vehicula vel velit non, feugiat commodo lectus. Praesent convallis dui nec porttitor cursus. In pulvinar, lorem eu efficitur ullamcorper, risus eros ullamcorper quam, a congue velit lectus non nibh. Sed a tortor quis libero gravida tristique. Sed non dignissim risus. Sed et ipsum mollis, semper ligula sodales, mollis risus. Praesent neque elit, congue a blandit quis, tincidunt non nibh. Pellentesque a velit non quam finibus tincidunt id in nunc. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec sed ipsum vitae elit mollis varius. Mauris at varius nibh. Aliquam feugiat eget dolor at rhoncus. Nulla pharetra sem vitae ipsum tincidunt, non condimentum ante ultricies. Proin pellentesque pellentesque lectus nec congue.[/border]
 

bigdiglets

New Member
Sort of, but without a border. What I'm wanting looks like a column but it's centered. I don't know what things are called. I thought it was called a centerblock.
 

bigdiglets

New Member
Like the optional text formatting in fanfiction.net. There is an option to read with the text at 3/4 full on the screen so it fits on mobile. The text is aligned in the center of the screen, but it doesn't go all the way across it.
 

Serobliss

「休 息」
Helper
Centerblock would work as well but that tends to not translate that well on mobile. You can experiment with it yourself see if you'd prefer the above code or centerblock. To remove the border, you just put "border=0" instead of "1px solid red".

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a erat ante. Donec ac consectetur lacus, in laoreet est. Suspendisse vehicula eu est quis pellentesque. Sed scelerisque augue nec consequat vestibulum. Fusce dui metus, tristique interdum malesuada at, posuere nec lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Pellentesque a orci non lorem rutrum sollicitudin. Duis ut lacinia augue. Aliquam in ipsum mollis, ultricies erat a, faucibus massa. Aenean nulla ante, sagittis vel congue volutpat, hendrerit id libero. Suspendisse ornare facilisis congue. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras fringilla sapien at augue malesuada venenatis. Aenean condimentum bibendum pharetra.

Etiam quam dolor, vehicula vel velit non, feugiat commodo lectus. Praesent convallis dui nec porttitor cursus. In pulvinar, lorem eu efficitur ullamcorper, risus eros ullamcorper quam, a congue velit lectus non nibh. Sed a tortor quis libero gravida tristique. Sed non dignissim risus. Sed et ipsum mollis, semper ligula sodales, mollis risus. Praesent neque elit, congue a blandit quis, tincidunt non nibh. Pellentesque a velit non quam finibus tincidunt id in nunc. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec sed ipsum vitae elit mollis varius. Mauris at varius nibh. Aliquam feugiat eget dolor at rhoncus. Nulla pharetra sem vitae ipsum tincidunt, non condimentum ante ultricies. Proin pellentesque pellentesque lectus nec congue.


Code:
[centerblock=50]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a erat ante. Donec ac consectetur lacus, in laoreet est. Suspendisse vehicula eu est quis pellentesque. Sed scelerisque augue nec consequat vestibulum. Fusce dui metus, tristique interdum malesuada at, posuere nec lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Pellentesque a orci non lorem rutrum sollicitudin. Duis ut lacinia augue. Aliquam in ipsum mollis, ultricies erat a, faucibus massa. Aenean nulla ante, sagittis vel congue volutpat, hendrerit id libero. Suspendisse ornare facilisis congue. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras fringilla sapien at augue malesuada venenatis. Aenean condimentum bibendum pharetra.

Etiam quam dolor, vehicula vel velit non, feugiat commodo lectus. Praesent convallis dui nec porttitor cursus. In pulvinar, lorem eu efficitur ullamcorper, risus eros ullamcorper quam, a congue velit lectus non nibh. Sed a tortor quis libero gravida tristique. Sed non dignissim risus. Sed et ipsum mollis, semper ligula sodales, mollis risus. Praesent neque elit, congue a blandit quis, tincidunt non nibh. Pellentesque a velit non quam finibus tincidunt id in nunc. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec sed ipsum vitae elit mollis varius. Mauris at varius nibh. Aliquam feugiat eget dolor at rhoncus. Nulla pharetra sem vitae ipsum tincidunt, non condimentum ante ultricies. Proin pellentesque pellentesque lectus nec congue.[/centerblock]

The lower the number, the tighter the padding gets.
 

bigdiglets

New Member
Ok thank you. I'll try both. The tighter the padding gets as in the margins on the side? Narrowing the text block?
 

Users who are viewing this thread

Top