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
    36
    Thanks
    0
    Thanked 1 Time in 1 Post

    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.


    Web Designing Companies in Delhi

  4. #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

  5. #5
    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>

    -------------
    Now The Health King offer free weight lose diet plans and Green Tea Recipes for weight lose and Fitness.

  6. #6
    Junior Member petershene's Avatar
    Join Date
    Aug 2017
    Location
    South Africa
    Posts
    54
    Thanks
    3
    Thanked 1 Time in 1 Post

    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

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
  •