Link to home
Start Free TrialLog in
Avatar of abohamad
abohamad

asked on

How create highlight html files from regular html file .

I have many html files and I want create copy of them after highlight some text I search about them . (huge number of html files can’t create manually )

User generated image
Avatar of Edwin Hoffer
Edwin Hoffer
Flag of United States of America image

Hello abohamad,

Use <span style="background-color:blue;">This is a Span.</span>, by this you can change background color of the text.

Hope my answer can help you. If you need any other help you can reply.

Thanks
Edwin
ASKER CERTIFIED SOLUTION
Avatar of Radek Baranowski
Radek Baranowski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of abohamad
abohamad

ASKER

I want use jsoup  for edit all html file

example html file
<html>
 <head></head>
 <body> 
  <div class="content" style="margin-left:10px;"> 
   <ul style="list-style-type: disc;"> 
    <li><span>obj: blue</span></li> 
    <li><span>descr: red</span></li> 
    <li><span>double: yellow</span></li> 
   </ul> 
  </div> 
 </body>
</html>

Open in new window


tha result result i wanted
<html>
 <head></head>
 <body> 
  <div class="content" style="margin-left:10px;"> 
   <ul style="list-style-type: disc;"> 
    <li><span>obj: <span style=\"background-color:red;\">blue</span></span></li> 
    <li><span>descr:<span style=\"background-color:red;\"> red</span></span></li> 
    <li><span>double: <span style=\"background-color:red;\">yellow</span></span></li> 
   </ul> 
  </div> 
 </body>
</html>

Open in new window

Hello abohamad,

You can change your text background through only css, you can use css by Linking, Embedding  and Inline CSS to HTML tags.

JavaScript is only to add effects in the page.

You can use class in div tags.

Example:

HTML Code:
<div class="background-red">
Add Content Here
</div>

Open in new window



CSS Code:

.background-red{
	background-color:red;
}

Open in new window


Or you can add it by span:

Example:

<span style="background-color:red;">Text Here</span>

Open in new window


Thanks
Edwin