Users Pricing

forum

home / developersection / forums / what is the best practice to align a text right next to a html div element

what is the best practice to align a text right next to a html div element

Anonymous User 2196 15 Jun 2013
Hi Expert,

I was creating a underscored list and in that list I wanted to add a color pallete type window and I tried to create one the following way

<ul><li><div style="width:10px; height:10px;  background-color:#0066cc; float:left;"></div>test</li></ul>

I am attaching a fiddle link to see the output.. Is there a good way to align the div to text or should I just adjust the margin of div element, but I don't think that is the best possible solution..

Thanks in advance. 


I am a content writter !


1 Answers