How to apply css when including html file

Viewed 63

I have an html file containing just the menu and include it on my html page using embed tag:

<embed type="text/html" src="menu.html">

How can I apply css class to the code being included? I tried adding it to the menu.html file but that did not work

3 Answers

The embed tag isolates the source file, so CSS in the parent page will not cascade into the embed element.

You will have to load the CSS file inside the menu.html file for it to apply to the content in that file.

Try Inline CSS classes in menu.html file.

Figured out the issue - I needed to set the width of embed tag to see the whole thing as by default the width did not allow me to see the entire file

Related