Magento Expert Forum - Improve your Magento experience

Results 1 to 6 of 6

How do you create multicolored text in a webpage?

  1. #1

  2. #2
    Junior Member
    Join Date
    Feb 2018
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    you can use the <font color=?color?>?</font> tags for every character

  3. #3
    Junior Member
    Join Date
    Feb 2018
    Posts
    113
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    To create text with different colors, use the <font color=?color?>?</font> tags for every character that you want to apply a color. You can use this tag combination as many times as needed, surrounding a single character or an entire word.


    Book Name Change Ad in Newspaper | Book Lost and Found Ad in Newspaper | Book Public Notice Ad in Newspaper
    Last edited by trzy; 24-04-2023 at 07:13 AM.

  4. The Following User Says Thank You to trzy For This Useful Post:

    Caylen (16-01-2020)

  5. #4
    New member
    Join Date
    Apr 2018
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Learm more about these at Web Designing Training in Chandigarh

  6. #5
    Junior Member petershene's Avatar
    Join Date
    Aug 2017
    Location
    South Africa
    Posts
    91
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default

    The best way would be as suggested above. However for such a simple thing i would not create inline style as it will case render block on you website and slow it down also making the code unusable on other pages. Rather put the css in a in you websites style sheet :


    Html :

    <span class="white">R</span>

    <span class="blue">a</span>

    <span class="pink">i</span>

    <span class="red">n</span>

    In the css you would have :

    .white {
    Color : #ffffff;
    }
    .whiteblue {
    Color : #xxxxx;
    }
    .pink {
    Color : #xxxxx;
    }
    .red {
    Color : #xxxxx;
    }

    \\ The xxxx is just because im too lazy to look up the hex codes for those colours. Now if you are on another page you can call on the class again you can also add other properties to the classes if you would like



    . multicolored {

    background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );

    background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );

    color:transparent;

    -webkit-background-clip: text;

    background-clip: text;
    THis however is also a pretty neat idea

  7. #6
    New member
    Join Date
    Apr 2018
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    <span style="color:#f00">R</span>

    <span style="color:#f50">a</span>

    <span style="color:#ff0">i</span>

    <span style="color:#5f0">n</span>

    In the above code, actually it is wrapping each letter in it’s own element.

    Otherwise, there is another way, you should write a below CSS code.

    . multicolored {

    background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );

    background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );

    color:transparent;

    -webkit-background-clip: text;

    background-clip: text;

    }

    Then call above CSS “multicolored” Class into your Html code. Below is the Html example.

    <span class="multicolored">Mobile app development and Web development company India</span>

    -------------
    Are you looking for Best Gifts and Toys for 3 Year Old girls (Review) in 2020. Get the list of best toys for your 3 years old Girls.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •