Guide on eliminating flex in CSS

Having an issue with aligning two grids created in HTML using Bootstrap. Below is the code:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>IRIS Flower Classification</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d4b6bbbba0a7a0a6b5a494e0fae2fae5">[email protected]</a>/dist/css/bootstrap.min.css">
  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ee4fffbebfcf7cebda0bba0bf">[email protected]</a>/dist/jquery.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1e6e716e6e7b6c30746d5e2f302f28302f">[email protected]</a>/dist/umd/popper.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b4d6dbdbc0c7c0c6d5c4f4809a829a85">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
</head>

<body>
    <h2 class="heading">
        IRIS Flower Classification
    </h2>
<div class="container-fluid">
  <div class="row">
    <div class="col1">
        <form action="{{url_for('predict') }}" method=post>
            <label type="text" for="Sepal_length">Sepal length:</label>
            <input type="number" id="sepal_length" name="sepal_length" step=".1" value=""><br>
            <label type="text" for="Sepal width">Sepal width:</label>
            <input type="number" id="sepal width" name="sepal width" step=".1" value=""><br>
            <label type="text" for="Petal length">Petal length:</label>
            <input type="number" id="Petal length" name="petal length" step=".1" value=""><br>
            <label type="text" for="Petal width">Petal width:</label>
            <input type="number" id="Petal width" name="Petal width" step=".1" value=""><br>
            <input type="submit" value="Predict">
        </form>
    </div>
    <div class="col2">
        <h2 class="testdata">
            Sample test data
        </h2>
        <table class="table">
            <tr>
                <th>Species</th>
                <th>Sepal length</th>
                <th>Sepal width</th>
                <th>Petal length</th>
                <th>Petal width</th>
            </tr>
            <tr>
                <td>Setosa</td>
                <td>5.4</td>
                <td>3.9</td>
                <td>1.7</td>
                <td>0.4</td>
            </tr>
            <tr>
                <td>Versicolor</td>
                <td>6.2</td>
                <td>2.2</td>
                <td>4.5</td>
                <td>1.5</td>
            </tr>
            <tr>
                <td>Virginica</td>
                <td>5.7</td>
                <td>2.5</td>
                <td>5</td>
                <td>2</td>
            </tr>
        </table>
    </div>
  </div>
</div>


 <br>
    <div class="output">
        <img height="241px" width="203px" src="/static/img/{{ prediction_answer }}.png" alt="No Prediction">
    </div>
</body>
</html>

Experiencing difficulty with aligning columns properly. Also seeking methods to create a column of a specified pixel size in HTML and how to remove flex.

Answer №1

To implement a responsive layout, consider utilizing the grid system provided by Bootstrap.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>IRIS Flower Classification</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0c6e6363787f787e6d7c4c38223a223d">[email protected]</a>/dist/css/bootstrap.min.css">
  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="751f040010070c35465b405b44">[email protected]</a>/dist/jquery.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ff8f908f8f9a8dd1958cbfced1cec9d1ce">[email protected]</a>/dist/umd/popper.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7d1f1212090e090f1c0d3d49534b534c">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
</head>

<body>

 <h2 class="heading text-center">
        IRIS Flower Classification
 </h2>
 
<div class="container-fluid">
  <div class="row">
    <div class="col-6">
        <form action="{{url_for('predict') }}" method=post class="row">
            <label type="text" for="Sepal_length" class="col-6">Sepal length:</label>
            <input type="number" id="sepal_length" name="sepal_length" step=".1" value="" class="col-6 pull-right"><br>
            <label type="text" for="Sepal width" class="col-6">Sepal width:</label>
            <input type="number" id="sepal width" name="sepal width" step=".1" value="" class="col-6 pull-right"><br>
            <label type="text" for="Petal length" class="col-6">Petal length:</label>
            <input type="number" id="Petal length" name="petal length" step=".1" value="" class="col-6 pull-right"><br>
            <label type="text" for="Petal width" class="col-6">Petal width:</label>
            <input type="number" id="Petal width" name="Petal width" step=".1" value="" class="col-6 pull-right"><br>
            <input type="submit" value="Predict">
        </form>
    </div>
    <div class="col-6">
        <h2 class="testdata">
            Sample test data
        </h2>
        <table class="table">
            <tr>
                <th>Species</th>
                <th>Sepal length</th>
                <th>Sepal width</th>
                <th>Petal length</th>
                <th>Petal width</th>
            </tr>
            <tr>
                <td>Setosa</td>
                <td>5.4</td>
                <td>3.9</td>
                <td>1.7</td>
                <td>0.4</td>
            </tr>
            <tr>
                <td>Versicolor</td>
                <td>6.2</td>
                <td>2.2</td>
                <td>4.5</td>
                <td>1.5</td>
            </tr>
            <tr>
                <td>Virginica</td>
                <td>5.7</td>
                <td>2.5</td>
                <td>5</td>
                <td>2</td>
            </tr>
        </table>
    </div>
  </div>
</div>


 <br>
    <div class="output">
        <img height="241px" width="203px" src="/static/img/{{ prediction_answer }}.png" alt="No Prediction">
    </div>
</body>
</html>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can someone guide me on developing a similar design utilizing HTML canvas with HTML 5 technology?

Hey everyone, I could really use some assistance on creating a design with Html 5 canvas. My current issue is that the rectangles I'm trying to generate are overlapping and not fitting properly within the canvas. Below, you'll find both a referen ...

Preventing Javascript Pop Up from automatically jumping to the top of the page

Upon clicking a button (refer to image below and take note of the scroll bar position), a div pop up is triggered through Javascript. View image: https://docs.google.com/file/d/0B1O3Ee_1Z5cRTko0anExazBBQkU/preview However, when the button is clicked, the ...

Set the minimum width of CSS headers <h1, h2, h3> to align next to a floated image

I am dealing with a layout issue where headlines should be displayed next to floated images if there is enough space, and drop below the images if not. Unfortunately, I do not have access to the HTML code, so I need to solve this problem purely through CSS ...

The conclusion of jQuery's nested animation

Functioning, But Page Transitions Inconsistent What I Believe to be the Correct Approach, But Event Triggering Issue Currently, I am experimenting with page transitions and utilizing bind() to detect the end of the CSS event transition. When a class is ad ...

Styling elements with CSS to achieve proper positioning

I am in search of a way to align rows utilizing the style property. The following HTML code is being transformed using XSL: <span style="white-space: pre; font-size: 8pt; font-family: Lucida console, Courier ">&lt;40 : item1</span>&l ...

Text remains constant until the mouse hovers over the image

Check out this Example Here is the HTML code: <ul class="img-list"> <li> <img src="http://s11.postimg.org/ynw9rnexf/Cetina_river.jpg" width="360px" height="280px" /> <span class="text-content"><span> Text To Dis ...

Android Font Icon Spacing Issue with IconFont (Fontastic)

After using Fontastic.me to create an iconfont, I encountered an issue specifically with the native browser of Android 4.2.2 and 4.3 (such as modern Samsung tablets). In these browsers, the characters in the entire font appear to have no width. This proble ...

Having trouble getting an Angular directive to bind a click event to an external element?

I've been working on creating a unique custom event for toggling with Angular. The directive I'm using is called toggleable. It may sound simple at first, but the tricky part is that I want to be able to use any button or link on the page for to ...

Creating a variety of themes with unique color palettes for Angular Material along with custom-designed components

One of the goals for my app is to have multiple themes, including Angular Material themes, with the ability to define custom colors for specific components and elements that are not part of Angular Material. It's important that when I change a theme, ...

angular bootstrap dropdown opening on the left side

I am facing an issue with the angular bootstrap dropdown. I have successfully implemented it, as shown in this link. However, the problem is that the dropdown opens on the right side by default. Is there a way to make it open on the left side instead? Bel ...

Determine the number of elements chosen within a complex JSON structure

I need to figure out how to count the length of a jsonArray, but I'm stuck. Here's an example to start with: https://jsfiddle.net/vuqcopm7/13/ In summary, if you click on an item in the list, such as "asd1", it will create an input text every t ...

Two Mistakes Found in the Dropdown Menu

Can anyone assist me with two errors I am encountering in my "Drop Down Menu"? Error 1: Whenever I hover towards the right direction in the sub-menu (e.g., Portfolio 2), a black box appears. This issue does not occur when hovering above the text (e.g., P ...

How can we create responsive websites?

Since starting my Software Developer studies about 3 months ago, I've been working on a website project for a driving school with a team of four. The issue we're facing is that when we transfer and open files between laptops, the website layout a ...

Selecting the incorrect label while hovering over a checkbox

I am using Bootstrap and encountering an issue with displaying checkboxes after clicking on an accordion element. While the first checkbox is displayed correctly, the checkboxes inside the accordion do not appear as expected. It is confusing to me why thi ...

Retrieve the class that corresponds to the element in the given list

In my JavaScript code, I have a NodeList of elements that were selected by querying multiple classes. I am using a "for" loop to iterate through the list. What I need is a concise one-liner to quickly determine which class each element was selected by so I ...

Customizing Column Background Color with AngularJS

https://i.sstatic.net/OHFFF.png My current webapp highlights the day of the week on a table for the current day and the day two weeks from now. However, I'm facing an issue with adjusting the highlight if either of these days falls on a holiday. Curr ...

Learn the technique of swapping out a portion of a string with a value from an input field in real-time

My webpage has a form on the left side where users can input text, and on the right is some static text. I want the text on the right to update automatically as the user types in the input field on the left. In my HTML code, it looks something like this - ...

How can a loading bar be shown while a PHP page is loading?

I currently have an HTML form that directs to a PHP file upon submission. The PHP file takes some time to load due to background processes running, so I am interested in implementing a progress bar or alert to indicate when the file is fully loaded. Does ...

Enhancing HTML Vue JS by Dynamically Adding Rows Based on Multiple Selections

<div id="addForm"> <div class="row"> <div class="col-md-4"> <div class="form-group label-floating"> <label class="control-label">Case Type</label> <select class="form-control" v-mo ...

How can I utilize CSS to dictate color schemes on an HTML5 canvas element?

Currently, I am working on a checkers project where the first step is to create the initial board. The way we are currently implementing this has raised a philosophical concern. We are using the fillRect function to define the color of the "dark" squares a ...