-1

I have a select and a button. Their default size in a browser is tiny. I want to increase the size of both for better visibility. I found how to make the button larger, but the same trick is ignored in the select. Any suggestions how to do this will be greatly appreciated.

<select id="selectFunction" size=3 onchange="readSelection()">
            <option value="0"> <style="font:bold 16px Arial"> z = r&#x00B2</option>
            <option value="1">z = r&#x00B4</option>
            <option value="2">z = x&#x00B2-y&#x00B2</option>
            <option value="3">z = 100xy-x&#x00B2-y&#x00B2</option>
            </select>
            
            <button type="button" style="font:bold 16px Arial"; onclick="draw()">Draw</button>
dgpdx
  • 9
  • 4

1 Answers1

0

Look at the code you wrote:

<option value="0"> <style="font:bold 16px Arial"> z = r&#x00B2</option>
...
<button type="button" style="font:bold 16px Arial"; onclick="draw()">Draw</button>

They have different syntax. In button, you wrote the styles directly inside the <> encapsulating button. However, for the option tag, you wrote an entirely different tag <style>.

If you write it as below:

<select id="selectFunction" size=3 onchange="readSelection()" style="font:bold 16px Arial">
...
<button type="button" style="font:bold 16px Arial"; onclick="draw()">Draw</button>

You should be able to achieve what you want to do.

However, I assume you are a beginner to HTML/CSS and this is definitely not the most efficient way to go about styling your HTML. I suggest you read a little bit about CSS, follow a tutorial, something like that, before starting to write your code from scratch. It will help you a lot more than just trying it out and solving problems you encounter as you go.

cSharp
  • 2,884
  • 1
  • 6
  • 23
  • Your suggestion doesn't work either. The select is still shown at the default size. Yes, i am inexperienced and I will follow your suggestion, but I'd like to solve this problem quickly, if that is possible. – dgpdx Apr 14 '22 at 02:48
  • I just checked, and you're right. Maybe ` – cSharp Apr 14 '22 at 03:01
  • I found how to do this at https://tutorialdeep.com/live-editor/css-style-select-dropdown/ – dgpdx Apr 14 '22 at 03:17