Manage Tags & Attributes

This feature lets you customize the tags and their attributes. You can add and delete attributes, for example, say you had this code in your file:

<p>First paragraph.</p>

And you wanted to apply your CSS Stylesheet to the text, then you could use this feature to add this attribute:

<p class="className">First paragraph.</p>

Actions

Add attribute
Remove attribute
Append HTML to elements
Prepend HTML to elements
Remove elements
Wrap elements
Wrap inner content of elements
Unwrap elements
Replace elements


Here is an overview of the section options

1 – Tag or attribute actions drop down – select what you would like to do.

2 – HTML tag (element) like p, span, div or jQuery selector like div.p or .someClass
More info about jQuery selectors: https://www.w3schools.com/jquery/jquery_ref_selectors.asp

3 – HTML attributes like id, class, style etc. Please note that class and style attributes at treated differently if you enter some values for them.
4 – Enumerate attribute values on/off.

5 – Start number when enumerating attribute values.

6 – Attribute or tag values. This field can contain HTML too.

7 – List of actions that will be performed on HTML.


Add attribute examples:

Add a class attribute to p tags. Input HTML:

<p>First paragraph.</p>

<p>Second paragraph.</p>

<p>Third paragraph.</p>

<div>

Last section.

</div>

Output HTML after clicking Cleanup my HTML green button:

<p class="className">First paragraph.</p>

<p class="className">Second paragraph.</p>

<p class="className">Third paragraph.</p>

<div>

Last section.

</div>

Please note that div tag does not have a class attribute.


Add class attribute to p and span tags. Input HTML:

<p>First paragraph.</p>

<p>Second paragraph.</p>

<p>Third paragraph.</p>

<span>Fourth line.</span>

<div>

Last section.

</div>

Output HTML:

<p class="className">First paragraph.</p>

<p class="className">Second paragraph.</p>

<p class="className">Third paragraph.</p>

<span class="className">Fourth line.</span>

<div>

Last section.

</div>

Please note that div tag has no class attribute only p and span tags.


Add enumerated (starts from 1) id to p tags. Input HTML:

<p>First paragraph.</p>

<p>Second paragraph.</p>

<p>Third paragraph.</p>

Please note that you can add numbers (enumerate any attributes, but usually it only makes sense for id attribute).

Output HTML:

<p id="prefix1">First paragraph.</p>

<p id="prefix2">Second paragraph.</p>

<p id="prefix3">Third paragraph.</p>


Add a class to p tags. Input HTML:

<p>First paragraph.</p>

<p>Second paragraph.</p>

<p>Third paragraph.</p>

Output HTML:

<p class="className">First paragraph.</p>

<p class="className">Second paragraph.</p>

<p class="className">Third paragraph.</p>


Add or replace a single CSS style to p tags. Input HTML:

<p style="color: red">First paragraph.</p>

<p>Second paragraph.</p>

<p>Third paragraph.</p>

Note: to add or replace particular CSS style please enter only one CSS rule. If you enter more rules then whole style attribute value will be replaced if style attribute already exists for a given tag.

Output HTML:

<p style="color: red; font-weight: bold;">First paragraph.</p> 

<p style="font-weight: bold;">Second paragraph.</p> 

<p style="font-weight: bold;">Third paragraph.</p>

Remove className CSS class from p tags. Input HTML:

<p class="className className2">First paragraph.</p>

<p class="className className2">Second paragraph.</p>

<p class="classNameTest">Third paragraph.</p>

className was removed from first two p tags. Output:

<p class="className2">First paragraph.</p>

<p class="className2">Second paragraph.</p>

<p class="classNameTest">Third paragraph.</p>


Remove class attribute from all p tags. Input HTML:

<p class="className2">First paragraph.</p>

<p class="className2">Second paragraph.</p>

<span class="classNameTest">Third paragraph.</span>

Value field has to be empty in order to delete all class attributes from p tags.

Output HTML:

<p>First paragraph.</p>

<p>Second paragraph.</p>

<span class="classNameTest">Third paragraph.</span>


Remove class attribute from every HTML tag (element). Input HTML:

<p class="className2">First paragraph.</p>

<p class="className2">Second paragraph.</p>

<span class="classNameTest">Third paragraph.</span>

Enter * char in tag field in order to remove class from every HTML element. Please note that * char can be used for other tag actions too.

Output:

<p>First paragraph.</p>

<p>Second paragraph.</p>

<span>Third paragraph.</span>


Remove class attribute from <span> tags inside <p> tags. Input HTML:

<p class="className">First paragraph.</p>

<span class="classNameTest">Second paragraph.</span>

<p>

<span class="classNameTest">Third paragraph.</span>

</p>

Entering ‘p span’ means that all <span> tags inside of <p> tags will be affected.

Only class attribute from ‘Third paragraph’ span tag was removed. Output:

<p class="className">First paragraph.</p>

<span class="classNameTest">Second paragraph.</span>

<p>

<span>Third paragraph.</span>

</p>


Append HTML to elements (tags). Input HTML:

<p>First paragraph.</p>

<p>Second paragraph.</p>

<p>Third paragraph.</p>

Each <p> tag was added <span class=”red”>some text</span> before ending </p>. Output:

<p>First paragraph.<span class="red">some text</span></p> 
<p>Second paragraph.<span class="red">some text</span></p> 
<p>Third paragraph.<span class="red">some text</span></p>

Prepend HTML to elements (tags). Input HTML:

<p>First paragraph.</p>

<p>Second paragraph.</p>

<p>Third paragraph.</p>

Each p tag was added <span class=”red”>some text</span> after starting <p>. Output:

<p><span class="red">some text</span>First paragraph.</p> 
<p><span class="red">some text</span>Second paragraph.</p> 
<p><span class="red">some text</span>Third paragraph.</p>

Remove elements from HTML. Input HTML:

<p>First paragraph.
<span class="red">some text</span>
</p> 
<p>Second paragraph. 
<span class="red">some text</span>
</p> 
<p>Third paragraph. 
<span class="red">some text</span>
</p>
<span class="red">some other text</span>

Selector ‘p span’ will remove all <span> tags in <p> tags. Last <span> was not removed because it was not inside of <p> element. Output HTML:

<p>First paragraph.</p> 
<p>Second paragraph.</p> 
<p>Third paragraph.</p>
<span class="red">some other text</span>

Wrap <p> tags with <div> elements. Input HTML:

<p>First paragraph.</p> 
<p>Second paragraph.</p> 
<p>Third paragraph.</p>

Each <p> tag will be wrapped with <div class=”wrapped”>… </div>. Output HTML:

<div class="wrapped"><p>First paragraph.</p></div> 
<div class="wrapped"><p>Second paragraph.</p></div> 
<div class="wrapped"><p>Third paragraph.</p></div>

Wrap <p> tags inner content with <div> elements. Input HTML:

<p>First paragraph.</p> 
<p>Second paragraph.</p> 
<p>Third paragraph.</p>

Each inner text inside of <p> tags will be wrapped with <div class=”innerWrap”>…</div>. Output HTML:

<p><div class="innerWrap">First paragraph.</div></p> 
<p><div class="innerWrap">Second paragraph.</div></p> 
<p><div class="innerWrap">Third paragraph.</div></p>

Unwrap <p> elements (remove surrounding <p> elements but keep inner content). Input HTML:

<div><p>First paragraph.</p></div>
<div><p>Second paragraph.</p></div> 
<div><p>Third paragraph.</p></div>

Output HTML:

<div>First paragraph.</div>
<div>Second paragraph.</div> 
<div>Third paragraph.</div>

Unwrap <div> elements (remove surrounding <div> elements but keep inner content). Input HTML:

<div><p>First paragraph.</p></div>
<div><p>Second paragraph.</p></div> 
<div><p>Third paragraph.</p></div>

Output HTML:

<p>First paragraph.</p>
<p>Second paragraph.</p> 
<p>Third paragraph.</p>

Replace elements with HTML or text. Input HTML:

<div><p>First paragraph.</p></div>
<div><p>Second paragraph.</p></div> 
<div><p>Third paragraph.</p></div>

Every <p>…</p> tag was replaced with <span>replacement text</span>. Output HTML:

<div><span>replacement text</span></div>
<div><span>replacement text</span></div> 
<div><span>replacement text</span></div>

Using find and replace

You can use the find and replace section to further customize your HTML. You can search for any text and replace or delete it. Find and replace supports regular expressions. You can have multiple several find and replace entries and you can also choose the order in which they run (entries are executed from first to last).

Please note that every occurrence of a given text to find will be replaced or deleted.

Usage examples

Simple find and replace of text in HTML

  1. Select some text in your HTML Editor (1) and click Add to Find button (2). Word to HTML will automatically add selected text into find input field (3). The same can be done with Ctrl+C (copy) and Ctrl+V (paste).
  2. Then add replacement text (4) or leave it empty if you want to delete given text occurrences from HTML.
  3. Click Add button (5). You should see find and replace item on the list (6).

Click Cleanup my HTML button to see results of find and replace:


Delete HTML or text

  1. Select some text in your HTML Editor (1) and click Find and Delete button (2). Word to HTML will automatically add selected text into items to delete (3).

Click Cleanup my HTML button to see results of find and replace. As you can see below <p>Second paragraph.</p> was removed:


Change all <p>…</p> to <span>…</span> tags (basic scenario without regular expressions)

Input HTML:

<p>First paragraph.</p>
<p>Second paragraph.</p>
<p>Third paragraph.</p>

Find and replace items:

Output HTML after cleanup (all p tags changed to span tags):


Change all <p…>…</p> to <span…>…</span> tags (more advanced scenario with regular expressions)

Usually, HTML start tags contain attributes so find replace is not that simple and the best way to do it is to use regular expressions. Input HTML:

<p>First paragraph.</p>
<p id="test">Second paragraph.</p>
<p style="color: red">Third paragraph.</p>

In order to find (match) any <p…> tag you have to use regular expressions (1). Basically <p([^<>]*)> will find any <p…> start tag. Replace value (2) has $1 which means that anything that was found/matched by ([^<>]*) will be copied to replace value. In order to use regular expressions please tick ‘Use regular expression’  checkbox (3). Below you can see find and replace with regex on the list (4).

Output HTML after cleanup (all p tags changed to span tags and all attributes are there):


Typical uses for find and replace

  • Replacing words or phrases in your text
  • Changing font types, eg change arial to verdana, modify CSS styles
  • Find and deleting code you do not need

More information about regular expressions (RegEx)

Advanced users can use regular expressions to create more powerful find and replace commands. This is a good introductory guide to RegEX https://www.w3schools.com/js/js_regexp.asp

Using the HTML cleanup options

These options let you easily control what you want to be removed from your code. All you have to do is enable the toggle of the options you need.

You can hover over any option to see more information:

Remember you always need to click the green ‘Cleanup my HTML’ button to run the options, it is not automatic.

If you don’t like how an option affected your code you can click the undo button below the code editor to revert it to how it was then you can try a different option.

Creating cleanup templates

When you find the cleanup options that work best for you, you can easily save them to a template for future use.

Every option you have in the HTML cleanup section, find and replace, CSS styles to keep/remove and custom Javascript will be saved to your template file.

All you have to do is click the blue save button to save your template. You can then reuse your template anytime by selecting it from the drop-down templates list.

If you click on the arrow to the right of the save button you will be able to rename, duplicate and delete your template.

It is important that you click the green cleanup my HTML button to run your template.

Uploading and converting Word, PDF and other documents

Word to HTML lets you upload your own documents to convert them to HTML instantly. All you have to do is click the blue upload button to select your file.

The file formats we support are:

  • MS Word doc and docx
  • PDF files
  • Rich text format
  • Open doc format
  • Txt files

Embed images

Selecting the embed images option converts your images to code. This means you do not need to have separate image files, everything is in the one document. This option is useful for small images like graphics but if you have a lot of images in the file it may increase the size and complexity of the code. Be aware when you embed images the code can look strange, you will see lots of random looking code as shown in the screenshot below. But don’t worry when you put the HTML live the images will show ok.

Full page mode

Creating standalone HTML files? No problem, this option adds the <head> and <body> to HTML, you need this so the page displays correctly. If you are pasting into a web-based system like WordPress, Amazon, eBay etc. you will not need this option.

Fixed HTML

If you need your HTML to look exactly like your input document then tick this fixed HTML option, but please be aware that fixed layout may not look great on mobile devices. It’s useful when used as standalone HTML page or when shown in an <iframe>. This option enables Full page mode option which is required to correctly display fixed HTML page.

Converting images to text with OCR

If your PDF file has text content in an image format we will attempt to OCR it and convert it to text.

Resizing windows / customizing interface

The interface can be changed to suit your needs. By clicking the arrows between the two editors you can choose to make one larger or smaller. Dragging the corners of the editors lets you make their windows taller.

 

Dark theme

If you prefer it you can activate the dark theme for the code editor

 

Full-screen mode

In the visual editor and the code editor, you can choose to go full screen.

Quick start guide

Word to HTML is super simple to use. All you have to do is paste in your text into the visual editor box on the left or you can create your content directly in the editor.

We will automatically convert your text to code as you type, you don’t need to do anything. Your code will appear on the box on the right.

When you have finished you can just copy the code from the code editor.

Watch our quick 1 minute feature overview video:

Cleaning up your code

With our powerful cleanup options, you can improve your code with a few simple clicks. Just turn on the options you want to remove then click the green ‘Clean up my HTML’ button. You need to click the green button every time you change an option in the cleanup section.

Saving files

You can save your files so you can work on them later. You can save as many files as you like. Just click the blue save button. Turning autosave on means we save your work for you automatically, if you turn this off you need to remember to hit the save button to save your work.

Exporting files

You can export your files to HTML, word or PDF format. All you have to do is click the drop-down option on the save button, then select the option you want:

Use google or other web fonts

Google fonts are a great way to make your web-pages more visually appealing. Hundreds of great looking fonts are available, and best of all they are free.

How to define your fonts:

  1. Go to the Google Fonts website to get your font links.
  2. Select the font you want to use, optionally customise it and copy it’s link as shown on the screenshot below.

  1. Paste the font link into the custom font links field on the Settings page.
  2. Enter the font name into font names field.

If you want to use more fonts just enter the font links and names separated by the # char.

Once your fonts are defined you can then select them in the visual editor: