?
Solved

Customizing Drop Down Menu

Posted on 2005-05-03
7
Medium Priority
?
157 Views
Last Modified: 2010-04-06
How can I customize a simple drop down menu? I would like to customize such things as background color, font size, etc.

To avoid confusion, I'm refering to the following drop/pull down menu:

<form method="POST">
    <select name="menu" size="1">
    <option value="http://www.domain.com">Option 1
    <option value="http://www.domain.com">Option 2
    <option value="http://www.domain.com">Option 3
    </select>
</form>

I've tried using:

style="color: #000000; font-size: 15px;"

However, it doesn't seem to work.

If at all possible, I would like to keep the customization elements within the form code, without using internal or external CSS (if this makes any sense).

Thanks!
0
Comment
Question by:spyderx
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
Batalf earned 400 total points
ID: 13916123
You have to use CSS to format your form elements.

example:

<style type="text/css">
.formattedOption{
    color:#FF0000;
    background-color:#EEEEEE;
    font-weight:bold
}
option{
    color: #000066;
}
input{
    background-color: yellow;
}
</style>
<form method="POST">
    <select name="menu" size="1">
    <option class="formattedOption" value="http://www.domain.com">Option 1
    <option value="http://www.domain.com">Option 2
    <option value="http://www.domain.com">Option 3
    </select>
<input type="text">
</form>

Batalf
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 13916273
Just a side note here...

You should close your option tags...

</option>

Regards,
Max.
0
 

Author Comment

by:spyderx
ID: 13956842
I see, so I would have to use CSS to format the form elements.

Is there a simpler, more compact way I can customize it?

Thanks.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 14027465
Using stylesheets is the most compact you will get spyderx...

Regards,
Max.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question