GerRax
GerRax

Reputation: 69

The labels do not show in the browser

I am trying to create two forms where each line of the form has a submit button in the end. The idea that I want to create is as the image below. enter image description here

However, by writing the following code


<div class="form widget widget-medium">
    <div class="widget-header title-only">
        <h2 class="widget-title">Queue View</h2>
    </div>
    <form method="POST">
        

        <div>
            <label for="Queue 1" class="col-md-4 col-form-label text-md-right"></label><br />
            <button type="submit" class="btn medium">
                <span>View</span>
            </button>
        </div>

        <div>
            <label for="Queue 2" class="col-md-4 col-form-label text-md-right"></label><br />
            <button type="submit" class="btn medium">
                <span>View</span>
            </button>
        </div>

        <div>
            <label for="Queue 3" class="col-md-4 col-form-label text-md-right"></label><br />
            <button type="submit" class="btn medium">
                <span>View</span>
            </button>
        </div>

        <div>
            <label for="Queue 4" class="col-md-4 col-form-label text-md-right"></label><br />
            <button type="submit" class="btn medium">
                <span>View</span>
            </button>
        </div>


    </form>
</div>

<div class="form widget widget-medium">
    <div class="widget-header title-only">
        <h2 class="widget-title">Booking View</h2>
    </div>
    <form method="POST">
        

        <div>
            <label for="Booking 1" class="col-md-4 col-form-label text-md-right"></label><br />
            <button type="submit" class="btn medium">
                <span>View</span>
            </button>
        </div>

        <div>
            <label for="Booking 2" class="col-md-4 col-form-label text-md-right"></label><br />
            <button type="submit" class="btn medium">
                <span>View</span>
            </button>
        </div>

        <div>
            <label for="Booking 3" class="col-md-4 col-form-label text-md-right"></label><br />
            <button type="submit" class="btn medium">
                <span>View</span>
            </button>
        </div>

        <div>
            <label for="Booking 4" class="col-md-4 col-form-label text-md-right"></label><br />
            <button type="submit" class="btn medium">
                <span>View</span>
            </button>
        </div>


    </form>
</div>

I got this result:

enter image description here

Does anybody may know what is the problem that the labels do not show? Regarding the styling I still have not fix it, but my main problem are the labels that are not showing.

Thank you in advance.

Upvotes: 0

Views: 408

Answers (1)

Quentin H
Quentin H

Reputation: 121

You don't have any text in your <label> tags.

And secondly, your <label> are linked with the for attribute to a non-existent id. You should put an id on the buttons (with the same value as the for attribute)

Upvotes: 1

Related Questions