I am making a page for my work website that has a google map on it, then some color coded poly lines on the map. I am making a map legend, with a little colored square and a description that correspond to a colored line on the map. Here is the source for that map legend:
<div id="key" style="background-color: #cccccc; float: right; width: 250px; height: 300px;">
<img src="img\red.png" /> <h3>Section A</h3>
<img src="img\green.png" /> <h3>Section B</h3>
<img src="img\blue.png" /> <h3>Section C</h3>
<img src="img\yellow.png" /> <h3>Section D</h3>
<img src="img\pink.png" /> <h3>Section E</h3>
<img src="img\white.png" /> <h3>Section F</h3>
</div>
- <div id="key" style="background-color: #cccccc; float: right; width: 250px; height: 300px;">
- <img src="img\red.png" /> <h3>Section A</h3>
- <img src="img\green.png" /> <h3>Section B</h3>
- <img src="img\blue.png" /> <h3>Section C</h3>
- <img src="img\yellow.png" /> <h3>Section D</h3>
- <img src="img\pink.png" /> <h3>Section E</h3>
- <img src="img\white.png" /> <h3>Section F</h3>
- </div>
And here is how it looks:
What I am trying to make happen is to get the little squares and the text to stay on the same line, but that isn't working. I've tried playing around with putting the <img>'s in their own div elements and floating them left, then the <h3>'s in their own div and floating them right, but that looks more awkward that it does now. What would you do to make it straighten out?
Like Mr Spork, I also write about my interest in alcoholic beverages.