c# - Not able to display image and text side by side using float -


i want display image , text side side (image on left , text on right(which ordered using ).

i achieved in .html page in visual studio

for image div gave float: left , text div gave float:right

i want achieve same passing html page code string variable , displaying ouput in webbrowser.

eg:

string html= @"<div style=""float:left"">         <img src=""smiley.jpg"" alt=""smiley"" />         <div style=""float:right;font-family:calibri"">             <h2>dispalying image , text</h2>                    </div>     </div>"  webbrowser1.documenttext = html; 

but here, image , text not displayed side side instead text displayed in next line. float:right not working expected here. how resolve this?

you may this:

<div style="float:left">    <img style="display:inline-block;vertical-align:middle" src="http://www.smilys.net/lachende_smilies/smiley7702.jpg" alt="smiley" />    <div style="display:inline-block;font-family:calibri">      <h2>dispalying image , text</h2>               </div>  </div>


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -