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 )

How create highlight html files from regular html file .
Java

Avatar of undefined
Last Comment
Edwin Hoffer

8/22/2022 - Mon
Edwin Hoffer

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
Radek Baranowski

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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

Edwin Hoffer

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
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck