Default styling for all the text
See original GitHub issueWe got response in two format. Sometimes we got HTML tag within the response but sometimes we got plain string.
We do styling bases on the tags like given below. I want to apply the styling for all the text whether they are wrapped in HTML tag or not.
const webViewStyle = StyleSheet.create({ p: { color:"red", }, })
const body = "<p>Display Text</p>"
const body = "Display Text"
<HTMLView style={styles.content} value={subHeader} stylesheet={webViewStyle} />
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Fundamental text and font styling - Learn web development
Default fonts. CSS defines five generic names for fonts: serif , sans-serif , monospace , cursive , and ...
Read more >CSS Default Browser Values for HTML Elements - W3Schools
Element Default CSS Value Try it
a:link:active color: (internal value) Try it »
a:visited:active color: (internal value) Try it »
abbr None.
Read more >How To Style Text Elements with Font, Size, and Color in CSS
The default font sizes for elements are relatively sized based on the parent element, in this case the <body> element, using a percent...
Read more >Basic CSS: Text Styling in CSS - GCFGlobal
Learn how to use CSS to style the text on a webpage by changing its size, font, boldness, and alignment.
Read more >Default Styles for CSS | George Ornbo
Coding CSS can quickly run into difficulties with different ... same in every browser but you can help yourself by using a default...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the reply @stefan-digital-chefs … But the solution is not working its not changing the colours for anything.😦
Weird. This works for me, just putting an element around the content string. Like this:
<HTMLView value={"<newCustomElement>"+subHeader+"</newCustomElement>"} stylesheet={webViewStyle} />}
And then provide a style for that element, like this:const webViewStyle = StyleSheet.create({ newCustomElement: { color:"red" } });