Home > Mobile >  keep margin between text and image
keep margin between text and image

Time:01-06

In my code I use the service and retrieve data from the backend. I have code like this to retrieve the content.

<div  *ngFor='let topic of topics | async'>
   <div [innerHTML]="topic.content"></div>
</div>

This topic.content have some text and image. What I want is keep margin between this text and image. But I have no idea to do that. Can someone help me on this.

CodePudding user response:

Based on your comments, if you change that inner div to:

<div  [innerHTML]="topic.content"></div>

then you can put in styles.css (global styles, not component's css file) something like:

.splitter > img { 
    padding-left: 10px; 
} 

But I don't know how you styled the 'body' class of the parent div and if there's styling in the .content value itself, so you will need to play a bit with that .splitter class.

  •  Tags:  
  • Related