Jump to content

Formatting within an option tag


henryhenry

Recommended Posts

I'm not sure if this is a bit hopeful...oh and this may be more of an HTML/XHTML question but also concerns CSS... Maybe there is a CSS solution without additional tags?<form> <select> <option>Hello <span><em>World</em><span></option> <option>Hello World</option> <option>Hello World</option> <option>Hello World</option> </select></form>I have one piece of data 'Hello' from one table on my DB and one piece of data 'World' from another. It is a list of categories with the description of the category. I have tried putting tags into the option/select so I can use CSS to align the 'World' part to the right and make it italic. But I have not had any luck ... any ideas?Thanks in advance :)Henry

Link to comment
Share on other sites

You want to align hello on the left and world on the right? I don't think it can be done. You might be able to align all your options on the right by styling the select instead of the option. I'm not even sure if the select will accept an alignment. I doubt it.

Link to comment
Share on other sites

Yeah that would work! If all your choices come from a db you could have a php script add in the correct number of spaces for you so if you add something in the db you don't have to add in spaces all the time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...