The tags on other websites are of different colors, and the tag tags of different sizes are very good. Here we will share two functions to make it easier for users who need them.
The tags on other websites are of different colors, and the tag tags of different sizes are very good. Here we will share two functions to make it easier for users who need them.
The Code is as follows:
Function getTagStyle (){
$ MinFontSize = 8; // minimum font size, which can be changed as needed
$ MaxFontSize = 18; // maximum font size, which can be changed as needed
Return 'font-size :'. ($ minFontSize + lcg_value () * (abs ($ maxFontSize-$ minFontSize ))). 'px; color :#'. dechbx (rand (0,255 )). dechbx (rand (0,196 )). dechex (rand (0,255 ));
}
This function outputs random styles, including font-size and color.
If you want to specify only a few font sizes, instead of being completely random, change the above function code:
The Code is as follows:
Function getTagStyle (){
$ Sizearray = array ('8', '9', '10', '11', '12', '20'); // customize the font size, can be modified as needed
Return 'font-size :'. $ sizearray [rand (0, count ($ sizearray)]. 'pt; color :#'. dechbx (rand (0,255 )). dechbx (rand (0,196 )). dechex (rand (0,255 ));
}