Line break between <option> and </option>

I have a select box at http://dot.kr/x-test/select01.php.

The option Germany is the default at the moment.
I should make Germany is something different from other country because it is default.
So I made it the font color and the background color is different from France and Japan.
It is Okay in deskTop browser, but android smartPhone, the font color and background color is not shown.
That is why I put the “country” is just above the “Germany”.
In this case,
I think “country
Germany” is better than the two option “countryGermany”
I can make it “country Germany” without
, but it is too wide in my design layOut.

An option tag is only allowed to contain text.

As it is a form field you are limited as to what styling can be applied.

Why would you need the line break in there? Aesthetics?

I have a select box at http://dot.kr/x-test/select01.php.

The option Germany is the default at the moment.
I should make Germany is something different from the other country because it is default.
So I made it the font color and the background color are something different from France and Japan.
It is Okay in deskTop browser, but android smartPhone, the font color and background color is not shown.
That is why I put the “country” is just above the “Germany”.
In this case,
I think <option>country<br>Germany</option> is better than the two option <option>country</option><option>Germany</option>
I can make it <option>country Germany<option> without <br>, but it is too wide in my design layOut.

What about

<optgroup>Country</optgroup><option>Germany</option>

if you are using break tag between option tags, while inserting values into db that will gives error

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.