skip to Main Content
    <div class="mySlides fade">  
      <img src="images/homepage1/youth_academy_black_history_2.JPG" 
      style="width:100%">
    <div class="text" style="color:black">Youth Academy</div>

The above code produces a picture with black text. Lets say I want a stroke(multicolor) ie black with silver outline of the text. In photoshop its called stroke. Can I do this in html code??

3

Answers


  1. .text {
      -webkit-text-stroke-width: 2px;
      -webkit-text-stroke-color: red;}
    

    something like this could work

    or

    .text {text-shadow: 1px 1px 3px red;}
    
    Login or Signup to reply.
  2. Hope this code helps you. In CSS you can use the text-stroke property to achieve this effect. All the Best!

    .text{
      -webkit-text-stroke-width: 0.5px;   
      -webkit-text-stroke-color: red;  
      text-stroke-width: 0.5px;
      text-stroke-color: yed;
      color: black;
      font-size: 18px;
      font-weight: 600;
    }
     <div class="mySlides fade">  
          <img src="images/homepage1/youth_academy_black_history_2.JPG" 
          style="width:100%">
        <div class="text" style="color:black">Youth Academy</div>
    Login or Signup to reply.
  3. The font-size has been increased in order to reflect the effect of text-stroke property of CSS. You may handle the font-size as per your convenience. Please let me know if this answer helps. Also, you could refer to https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-stroke link to study more about it.

    .mySlides.fade .text{
    -webkit-text-stroke: 0.4px yellow;
    text-stroke: 0.4px yellow;
    color: #000000;
    font-size: 30px;
    }
     <div class="mySlides fade">  
          <img src="images/homepage1/youth_academy_black_history_2.JPG" 
          style="width:100%">
        <div class="text" style="color:black">Youth Academy</div>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search