Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Is it correct to use html in labels?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-22-2016, 10:38 AM
 
Katsu Katsu is offline
 

eXpert
  
Join Date: Jun 2012
Posts: 349
 

Default Is it correct to use html in labels?

Hi forum,
I'm hoping someone may be able to help here.

Where the home page reads 'Featured Products', or, 'Winter Season Featured Products', I want to change the font and size. Is it correct and preferred practice to simply enter the label as html, like this:


<font face="Arial, Helvetica, sans-serif"><b><font size="4" color="#330000">Winter Season <font color="#CC0000" size="5">Featured</font> Products</font></b></font>


or, should this be done another way?


Instead of text, how would I enter an image?

Thanks in advance.
__________________
4.7.7
Light Responsive
Reply With Quote
  #2  
Old 11-22-2016, 10:55 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Is it correct to use html in labels?

You can use html formatting in language variables although this is not a prefer way of doing it. If you or someone else want to change it later it is a pay to find out what exactly was done.

Also you should not use <font> tag - this has been deprecated for years. Instead use <span> and style it. Better yet use it with a class and add css rules for that class.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Katsu (11-22-2016)
  #3  
Old 11-22-2016, 11:06 AM
 
Katsu Katsu is offline
 

eXpert
  
Join Date: Jun 2012
Posts: 349
 

Default Re: Is it correct to use html in labels?

Thanks Steve. I was thinking that.

Quote:
Instead use <span> and style it. Better yet use it with a class and add css rules for that class.

Not too sure how to go about that......


How about replacing text with a pic?
__________________
4.7.7
Light Responsive
Reply With Quote
  #4  
Old 11-22-2016, 11:09 AM
 
Katsu Katsu is offline
 

eXpert
  
Join Date: Jun 2012
Posts: 349
 

Default Re: Is it correct to use html in labels?

When adding css rules, do I edit skin/common_files/css?
__________________
4.7.7
Light Responsive
Reply With Quote
  #5  
Old 11-22-2016, 11:11 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Is it correct to use html in labels?

<span class="wordX">Word X <span class="wordY">Word Y</span></span>

span.wordX {color:red;font-weigh:bold}
span.wordY{color:blue}

You can add the css in common_files or alt skin you use, either one should work.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Katsu (11-22-2016)
  #6  
Old 11-22-2016, 11:55 AM
 
Katsu Katsu is offline
 

eXpert
  
Join Date: Jun 2012
Posts: 349
 

Default Re: Is it correct to use html in labels?

Works like a charm - thanks!

I revised as follows, but I also wanted to change the font and maybe underline a word.

}
span.wordX {color:red;font-size: 26px}
span.wordY{color:#339900}


Adding 'arial' after 26px didn't work.
__________________
4.7.7
Light Responsive
Reply With Quote
  #7  
Old 11-22-2016, 12:35 PM
 
Katsu Katsu is offline
 

eXpert
  
Join Date: Jun 2012
Posts: 349
 

Default Re: Is it correct to use html in labels?

Found it - just added the 'font: arial;'.


.... would love to add a pic in place of text though...



.
__________________
4.7.7
Light Responsive
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:03 AM.

   

 
X-Cart forums © 2001-2020