SHARE

I don’t do much CSS , but yesterday while editing a CSS theme I needed to move a content from left to center. Like in HTML, I replaced float:left to float:center, But there was no effect in design after searching around I found that there is no such thing as float:center in CSS. One of the method was to use  this code:  ” float:33em 9px 25.6%; ” . Even after adding this code, the content I have tried to move did not move to center . Then after searching I found that it can be moved using margin and easy way to do that is putting this code:

margin-left: auto;
margin-right: auto;

and remove float: code. This will automatically put the content to the center.

Also read: Automatically add browser specific CSS3 Properties with CSSFX.js

I don’t do much CSS , but yesterday while editing a CSS theme I needed to move a content from left to center.


( ! ) Warning: A non-numeric value encountered in /home/nepauvyx/nepallica.com/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 352
Call Stack
#TimeMemoryFunctionLocation
10.06174034792{main}( ).../index.php:0
20.06184036664require( '/home/nepauvyx/nepallica.com/wp-blog-header.php' ).../index.php:17
30.524651291152require_once( '/home/nepauvyx/nepallica.com/wp-includes/template-loader.php' ).../wp-blog-header.php:19
40.553151324504include( '/home/nepauvyx/nepallica.com/wp-content/themes/Newsmag/single_template_3.php' ).../template-loader.php:74
50.666852534536locate_template( ).../single_template_3.php:53
60.666952534648load_template( ).../template.php:643
70.667052544856require_once( '/home/nepauvyx/nepallica.com/wp-content/themes/Newsmag/loop-single-3.php' ).../template.php:684
80.681852572456td_module_single_base->related_posts( ).../loop-single-3.php:44
90.682152590920td_block_related_posts->render( ).../td_module_single_base.php:906
100.711152784640td_block->get_block_pagination( ).../td_block_related_posts.php:45