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 1797 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. 


Updated on 15-Jun-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By