I would like to display on a page that I am developing a hexadecimal value that is stored in my database. I did some testing but no success.
I tried to do something like this:
<?php echo "background-color:".$ProdCor->Cor;.""; ?>
The value in the bank field looks like this:
#ffff00
I'm trying to show the color in a page field.
The CSS that is related to the field is this:
.tovar_color_select {padding-bottom:19px;} .tovar_color_select p { margin-bottom:13px; text-transform:uppercase; font-weight:900; font-size:12px; color:#333; } .tovar_color_select a { position:relative; display:inline-block; margin-right:10px; width:32px; height:22px; }.tovar_color_select a:before { content:''; position:absolute; left:-4px; top:-4px; right:-4px; bottom:-4px; border:1px solid #e9e9e9; transition: all 0.1s ease-in-out; -webkit-transition: all 0.1s ease-in-out; } .tovar_color_select a:hover:before, .tovar_color_select a.active:before { border:2px solid #333; }
A tag completa é essa:
<div class="tovar_color_select"> <p>SELECIONE A COR</p> <?php foreach($ResCor as $ProdCor ) { ?> <a href="javascript:void(0);" ><?php echo "background-color:".$ProdCor->Cor; ?></a> <?php } ?>