0

I'm trying to do this:

enter image description here

into html so when I type some text the line gets longer or shorter. On the end of each line there is a small icon of height of 32px so I would image each line would be line-height:32px.

Shall I use <li> or div's and sort the icon next to the line next to the text with float:left? And how would the line increase it self? I would imagine the line would have a background-color and a height of 1px?

I'm not new to CSS, I'm just trying to think of the simplest way of doing this. Note that each line is a button which expands.

Thanks alot

Edit:

It will actually look something like this: enter image description here

Each div is a toggle button and I would like the grey line to be in the middle of the entire div if that makes sense.

Thanks alot again

jQuerybeast
  • 14,130
  • 38
  • 118
  • 196

2 Answers2

1

Simplest way I can think of is to use border-bottom on the text container, then push the text out with negative bottom.

Quite simple really, here you go: http://jsfiddle.net/pixelfreak/DCZSa/

pixelfreak
  • 17,714
  • 12
  • 90
  • 109
  • Thanks. I think there is a better way to show you what I'm aiming for which will make it easier for you to think of an alternative way. The
  • I believe it is not a solution since I haven't got many options. One minute I'm updating my question with a new image.
  • – jQuerybeast Aug 10 '11 at 23:29
  • @jQuerybeast Updated jsfiddle with icons. The
  • is really not a requirement. You can use whatever tag you like
  • – pixelfreak Aug 10 '11 at 23:33
  • Oops, the fiddle URL has changed – pixelfreak Aug 10 '11 at 23:36
  • The way you've did it, I would image that there would be few problems with the content of each
  • . Can you please check the update sir on the new upload pic? Thanks alot for your help. I am having a look at your updated fiddle.
  • – jQuerybeast Aug 10 '11 at 23:42