erich.wanker Posted May 9, 2017 Posted May 9, 2017 Hy, i save eMails as HTML-Files if i display the eMails in a UniHTMLFrame .. the css definition of the eMails change my uniGui -App style... Example: if i view a newsletter in UnihtmlFrame - the uniDBGRID -Layout is "centered" the html of the newsletter: <!DOCTYPE HTML> <html lang="de" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> body { margin: 0px !important; padding: 0px !important; width: 100% !important; -webkit-text-size-adjust: none !important; } table { margin: auto !important; } .ExternalClass * { line-height: 115% !important; } @media only screen and (max-width: 600px), (max-device-width: 600px) { img { max-width: 100% !important; height: auto !important; } *[class="full_width"] { width: 100% !important; } *[class="block_600"] { display: block !important; width: 100% !important; } *[class="100pc"] { width: 100% !important; height: auto !important; } *[class="50pc"] { width: 50% !important; height: auto !important; } *[class="center"] { text-align: center !important; } } @media only screen and (max-width: 480px), (max-device-width: 480px) { img { max-width: 310px !important; height: auto !important; } *[class="full_width"] { width: 320px !important; } *[class="block_480"] { display: block !important; width: 100% !important; } *[class="hide_480"] { display: none !important; visibility: hidden !important; } *[class="100pc_480"] { width: 100% !important; height: auto !important; } } </style> <!--TemplateBeginEditable name="DocumentTitle"--> <title>ARP</title> <!--TemplateEndEditable--> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head> <body bgcolor="#eeeeee"> any ideas how i can secure my stype? Quote
erich.wanker Posted May 10, 2017 Author Posted May 10, 2017 ok ... have written a litte crazy workaround ... i load the html file into a uniMemo .. after "clean" the lines and write it in the uniHTMLFrame... looks like this... for i:=0 to unimemo2.Lines.Count-1 do begin bereinigter_text :=unimemo2.Lines[i]; bereinigter_text:= StringReplace(bereinigter_text,'table {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'table{' , 'dummy{', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'body ' , 'dummy ', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'h1 {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'h2 {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'h3 {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'h4 {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'h5 {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'h6 {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'p, ul { ' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'p {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'* {' , 'dummy {', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,'p{' , 'dummy{', [rfReplaceAll]); bereinigter_text:= StringReplace(bereinigter_text,' href="',' target="_blank" href="', [rfReplaceAll]); ..... UniHTMLFrame1.HTML.Append(bereinigter_text); end; ... is a little bit dirty (!) .. but it works ... If someone has better ideas or better StringReplace-suggestions ... please let me know :-) ThanX Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.