mark tag in html5 with example


  1. The HTML <mark> tag is used for indicating text as marked or highlighted for reference purposes, due to its relevance in another context.
  2. The <mark> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.




Example 1 :




<html>
    <head><title>mark tag in html5</title></head>
    <body>
        <p>This is <mark>20 Fingers 2 Brains</mark>.</p>
        <p>HTML5 is <mark>amazing</mark>.</p>
    </body>
</html>


Demo :



In the above example, we have used mark tag. Mark tag indicates a marked text, by making its background-color to yellow. This helps in identifying the text on the document. We can change the default yellow color using CSS.



Example 2 : mark and style



<html>
    <head><title>mark tag in html5</title>
    <style type="text/css"">
    mark
    {
        background-color:skyblue;
    }
    </style>
    </head>
    <body>
        <p>This is <mark>20 Fingers 2 Brains</mark>.</p>
        <p>HTML5 is <mark>amazing</mark>.</p>
    </body>
</html>


Demo :



In the above example, we have changed the default background-color yellow to skyblue using CSS.


0 comments:

Post a Comment