I have an HTML page styled with CSS. I would like to copy it to Libre Office Writer, so that I can edit it. However, when I copy & paste, only the HTML is copied, without the style. I tried "Paste Special - HTML" and got the same results.
I use Libre Office 3.5.3.2 on Ubuntu 12.04.
To make LibreOffice open your default web browser and display the contents of an HTML document, go to File > Preview in Web Browser on the Menu bar, or click the Preview in Web Browser icon on the Standard toolbar. You can also open any web browser and then open the HTML file in it.
LibreOffice Writer can create, edit, and save web pages in HTML format using a configuration called Writer/Web.
Show the style “navigator” with F11 or Styles > Styles & Formatting . In the small toolbar, there is an icon with a down pointing arrow in rightmost position. Click on it and select Load Styles . In the dialog, check all style families and Overwrite so that identically named styles are replaced.
It seems that the style of <body>
is discarded and only inline CSS is used when you copy and paste. For me, copying from Firefox and pasting in LibreOffice, the following HTML didn't retain formatting:
<head>
<style type="text/css">
body { font-family: sans-serif; font-size: 15px; }
span { color: red; }
</style>
</head>
<body>
Lorem ipsum <span>dolor</span> sit amet.
</body>
and
<body style="font-family: sans-serif; font-size: 15px;">
Lorem ipsum dolor sit amet.
</body>
But the following worked as expected:
<body>
<div style="font-family: sans-serif; font-size: 15px;">
Lorem ipsum <span style="color: red;" >dolor</span> sit amet.
</div>
</body>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With