I'm trying to incorporate R Markdown into my website. However, whenever I do so the menu bar at the top of my page shift to the other side. I tried various fixes like putting the 'style' section that shifts the menu bar into the individual 'div' that contains the R Markdown code so that it doesn't effect the menu bar. But nothing seems to be working.
What do you mean exactly ? Other side like should be on the right and this is on the left ?
Only thing I think off is related to how your other website do with CSS or JS. Maybe there is some specific styling or processing that will modify the one from the html produced with rmarkdown.
html_document() will produce a full HTML document with <head> and <body> and will rely on some resources like specific CSS and JS library depending on the feature you are using (example, it uses bootstrap by default).
When you include in another website, this could all conflict with your website style, resources and rules. Usually not easy to include a full HTML in another place without doing an <iframe>.
There is html_fragment() format too that will only produce a <body> part, but some feature will be missing.
Anyhow, not sure how to solve this except trying to isolate the possible CSS rules that are impacting
This will be a full HTML document with <html><head> and <body>. Usually it is not advice to take all this and paste it in another website, the resources will conflict. html_fragment() will only give you a HTML version of you body and this should help.