In this article, I will show how to make text highlighted in html. You can create a css class for highlighting the text and apply to the html <span> tag. i.e css text highlight color.
Line spacing in Html code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
p {
font: 17px Arial, sans-serif, Helvetica,Verdana;
line-height: 1.5;
}
.highlight {
background-color: #FFFFCC;
color: #B24422;
}
</style>
</head>
<body style="border: 1px solid #e2d9d9; width: 500px; height: 340px">
<h1 style="color: #0480d1">Csshighlight color </h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
<span class="highlight">Aenean</span> commodo ligula eget dolor.
Aenean massa. Cum sociis natoque penatibus et magnis dis parturient
montes,nascetur ridiculus mus. Donec quam felis, ultricies
nec, pellentesque eu,pretium quis, sem. <span class="highlight">Nulla
</span> consequat massa quis enim.</p>
</body>
</html>
Description: I created css class and named as highlight and applied for the word using <span> tag. When I reloaded the page, the css is applied like css link effects.
Output:
Post your comments / questions
Recent Article
- Your system's memory configuration has changed since it entered hibernation.
- Save image to client browser using jQuery?
- Get filename of image jQuery?
- How to get the image src using JavaScript?
- System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Net.Http.Formatting' with identity 'System.Net.Http.Formatting, Version=4.0.0.0
- Cordova Android build error "Cannot read property 'length' of undefined". An error occurred while running subprocess cordova.
- ERROR in The Angular Compiler requires TypeScript >=3.9.2 and <4.0.0 but 3.8.3 was found instead
- Code ENOLOCAL Could not install from "android" as it does not contain a package.json file.
Related Article