Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I envelope my div with a border in html?

I have a piece of HTML code. I want to give a border to my div:

<div class="mb-3" style="width: 50%; margin: 0 auto; border: 2px black;">
  <label for="scannerName">Select preferred scanner :</label><br>
  <select name="scannerName" id="scannerName" style="text-align: center; width: 50%;"></select><br><br>
  <label for="pixelMode">Select pixel mode :</label><br>
  <select name="pixelMode" id="pixelMode" style="text-align: center; width: 50%;"></select><br><br>
  <label for="resolution">Select resolution :</label><br>
  <select name="resolution" id="resolution" style="text-align: center; width: 50%;"></select><br><br>
  <label for="imageFormat">Select image format :</label><br>
  <select name="imageFormat" id="imageFormat" style="text-align: center; width: 50%;"></select><br><br>
</div>

I had tried the inline style="border:2px black" but the border isn’t showing. How do I give the border?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need to specify the type of the border, for example the border will be solid with :

<div class="mb-3" style="width: 50%; margin: 0 auto; border: 1px solid black;">
    <label for="scannerName">Select preferred scanner :</label><br>
    <select name="scannerName" id="scannerName" style="text-align: center; width: 50%;"></select><br><br>
    <label for="pixelMode">Select pixel mode :</label><br>
    <select name="pixelMode" id="pixelMode" style="text-align: center; width: 50%;"></select><br><br>
    <label for="resolution">Select resolution :</label><br>
    <select name="resolution" id="resolution" style="text-align: center; width: 50%;"></select><br><br>
    <label for="imageFormat">Select image format :</label><br>
    <select name="imageFormat" id="imageFormat" style="text-align: center; width: 50%;"></select><br><br>
</div>
style="border solid 2px black"
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading