Dear coding friends, html experts give me a good suggestion for this....

RichKIDLK

BANNED
Joined
Aug 30, 2020
Messages
1,198
Reaction score
1,157
My friends, I need to center this items in this codes, how to do that proper way?

Code:
<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><center><!-- wp:shortcode --> [icon name="diamond" class="fa-3x"] <!-- /wp:shortcode --></center><!-- wp:heading {"textAlign":"center","level":4} -->
<h4 class="has-text-align-center">EXAMPLE TEXT</h4>
<!-- /wp:heading -->

Code:
<!-- wp:column -->
<div class="wp-block-column"><center><!-- wp:shortcode --> [icon name="address-card" class="fa-3x"] <!-- /wp:shortcode --></center><!-- wp:heading {"textAlign":"center","level":4} -->
<h4 class="has-text-align-center">EXAMPLE TEXT</h4>
<!-- /wp:heading -->

Code:
<!-- wp:column -->
<div class="wp-block-column"><center><!-- wp:shortcode --> [icon name="gift" class="fa-3x"] <!-- /wp:shortcode --></center><!-- wp:heading {"textAlign":"center","level":4} -->
<h4 class="has-text-align-center">EXAMPLE TEXT</h4>
<!-- /wp:heading -->

Code:
<p><!-- /wp:paragraph --></p>
</div>
</div>
<center>
<p>[maxbutton id="2"]</p>
</center>
<p>&nbsp;</p>



When I used <center> code in above examples to center those items yes, it do the job properly. That mean it centered the items I wanted. But it give an error in https://validator.w3.org/. I wanna fix that.

1611902739759.png



Thank you so much for help.
 
Code:
<center>
<p>[maxbutton id="2"]</p>
</center>

//

<p style="text-align: center;">[maxbutton id="2"]</p>

replace the first block with 2nd one.
 
You should use the CSS stylesheet and then apply the classname to the div that you want to center
 
Code:
<center>
<p>[maxbutton id="2"]</p>
</center>

//

<p style="text-align: center;">[maxbutton id="2"]</p>

replace the first block with 2nd one.

This one worked for this code. Thank you friend. One error is gone. Now need to look for other 5.
 
You should use the CSS stylesheet and then apply the classname to the div that you want to center

Actually I don't have so much knowledge about that. But thank you my friend.
 
1 error solved thanks to @thanhclix Now need to find how to center other 5 codes.
 
The other ones are going to depend on what Wordpress is sticking in between the square brackets. You can try:

Code:
<div class="wp-block-column" style="text-align: center;"><!-- wp:shortcode --> [icon name="diamond" class="fa-3x"] <!-- /wp:shortcode -->

Remove the
Code:
<center>
and
Code:
</center>
and add
Code:
 style="text-align: center;"
to the surrounding div.

Do that for each centered item.
 
<center> won't help, that's for sure.
I'd go with easy one - just add <span style="text-align: center;"> and end tag </span> for each of those elements (basiclly just replace <center> and </center>).
 
Back
Top