Here is the HTML code for my webpage:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<style type="text/css">
body{
margin: 0;
padding: 0;
width:100%;
height: 100%;
}
h5{
text-align: center;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
height: 30px;
font-size: 27px;
background-position: center;
color: Black;
padding: 75px;
background-size: contain;
}
</style>
<body>
<h5>
সমাপ্ত
</h5>
</body>
</html>
I used the following function in Android to implement this HTML page, but only the text is displayed without any CSS styling:
Spannable sequence = (Spannable) Html.fromHtml("<!DOCTYPE HTML>\n" +
"<html lang=\"en-US\">\n" +
"<head>\n" +
"\t<meta charset=\"UTF-8\">\n" +
"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n" +
"\t<title></title>\n" +
"</head>\n" +
"<style type=\"text/css\">\n" +
"body{\n" +
"margin: 0;\n" +
"padding: 0;\n" +
"width:100%;\n" +
"height: 100%;\n" +
"}\n" +
"h5{\n" +
"text-align: center;\n" +
"margin: auto;\n" +
"position: absolute;\n" +
"top: 0;\n" +
"left: 0;\n" +
"bottom: 0;\n" +
"right: 0;\n" +
"height: 30px;\n" +
"font-size: 27px;\n" +
"background-position: center;\n" +
"color: Black;\n" +
"padding: 75px;\n" +
"background-size: contain;\n" +
"}\n" +
"</style>\n" +
"<body>\n" +
"\t<h5>\n" +
"\t\tসমাপ্ত\n" +
"\t</h5>\n" +
"</body>\n" +
"</html>");
The HTML text is shown, but the CSS is not applied. Any suggestions on how to fix this issue would be greatly appreciated.