Attempting to create an aesthetically pleasing HTML container surrounding input fields

I'm attempting to create a border around multiple fields using HTML and CSS. I've tried placing <p> tags around my <form> tags, but it's not achieving the desired effect. Additionally, using <div> tags seems to be complicating things.

Does anyone know how I can simply add a black border around these 9 fields? I'm also using Angular and would appreciate any tips on creating a more polished look. I'm currently an intern at this new company and want to deliver outstanding work.

<!DOCTYPE html>
<html>
    <head>
        <style>
        p {
            width: 960px;
            border:1px solid black;
            margin: auto;
            padding: 10px;
            background: #ffffff

        }

    </style>
        <form class="form " role="form" >
            <div class="row ">
                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Ship To #</label>
                            <input type="text" class="form-control" ng-  model="shipToNumber" />
                        </div>
                    </div>
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Ship To Mnemonic</label>
                            <input type="text" class="form-control" ng-model="shipToMnemonic" />
                        </div>
                    </div>
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Ship To Name</label>
                            <input type="text" class="form-control" ng-model="shipToName" />
                        </div>
                    </div>
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Customer Order #</label>
                            <input type="text" class="form-control" ng-model="customerOrderNumber" />
                        </div>
                    </div>
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Load #</label>
                            <input type="text" class="form-control" ng-model="loadNumber" />
                        </div>
                    </div>
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Car Initials</label>
                            <input type="text" class="form-control" ng-model="carInitials" />
                        </div>
                    </div>
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Car #</label>
                            <input type="text" class="form-control" ng-model="carNumber" />
                        </div>
                    </div>
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Waybill #</label>
                            <input type="text" class="form-control" ng-model="waybill" />
                        </div>
                    </div>
                    <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
                        <div class="form-group">
                            <label>Carrier Name</label>
                            <input type="text" class="form-control" ng-model="carrierName" />
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </head>
</html>

Answer №2

Using div tags can be very helpful. It's true that they might seem confusing at first, but once you get the hang of them, they are a powerful tool :)

If you want to create a div containing columns similar to a form group, you can add a custom class of your own.

In your situation, you could try something like this:

html..

<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
    <div class="form-group myapp-nice-border col-xs-4 col-sm-4 col-md-4 col-lg-4 col-xl-4">
        <label>Ship To #</label>
        <input type="text" class="form-control" ng-model="shipToNumber" />
    </div>
</div>

css..

.myapp-nice-border {
    border: 1px solid black;
}

Give this a try and let me know if I misunderstood anything :)

Answer №3

To style the text fields within a form, you can use the following CSS code:

form input:not([type=submit]){
background-color: transparent !important;
color:white;
font-family: "Ek Mukta", sans-serif;
border: none;
border-radius: 0 !important;
box-shadow: none !important;
border-bottom: 2px solid white;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;

}

The use of !important is necessary at times to override existing Bootstrap styles.

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

Creating a stylish menu with CSS and Bootstrap featuring two beautifully designed rows

Looking to design a header for a webpage that features a logo on the left side in the center, along with two rows of menu items positioned on the right using CSS and Bootstrap classes. Below is an example layout: ---------------------------------------- ...

Generating a full HTML document within an iframe with the help of jQuery

Is there a method to display the entire HTML content of a different page within an iframe without simply altering the iframe src? ...

Tips for customizing the border radius style of the menu in Vuetify's v-autocomplete component

I am looking to customize the appearance of the drop-down list in the v-autocomplete component by adding a border-radius style, as depicted in the image below. The current design I have achieved closely resembles the visual shown below. Previously, I app ...

Prompt for user confirmation when a button is clicked using jQuery

I'm facing a situation that I haven't found an answer for yet. I have a button on my webpage that triggers an ajax call to perform a certain action when clicked. However, I want to add a confirmation popup with the message "Are you sure you want ...

Scraping the Web: Analyzing the Stats of Understat's Best Perform

I've been attempting to collect data from the Understat website (). While I successfully managed to scrape data for top players, I encountered difficulties when trying to do the same for top teams' data. Can someone please assist me with this tas ...

Curved edges conceal excess content + alter (Works in Firefox & Safari, but not in Chrome or Opera)

Trying to create rounded corners for a div to mask its children's content led me to a solution I found in this question. However, it appears that the solution does not work when the children elements are transformed. The following http://jsfiddle.net ...

The inability to display a Stylesheet is due to the unsupported MIME type, even though the MIME type seems to be missing when checking for errors

Every time I try to apply a specific style to a particular page on a website (even though the same style functions properly on other parts of the web server), an error message pops up. The error notification states Refused to apply style from 'styl ...

What's the best way to use a single tag with a class to replace multiple nested blockquote tags

I have a collection of messy HTML files filled with repeated blockquote tags used to showcase lines of poetry. For example: <blockquote><blockquote>roses are red</blockquote></blockquote><br> <blockquote><b ...

What is the best way to run a function once all resources have been resolved?

Is there a way to delay the execution of a function until all my resources have resolved successfully? I want to parse through the log array only after all the $resources have resolved and then push a single success notification to the UI instead of multip ...

The click event in an Angular 6 loop is not being activated

When the Test is clicked, the function should be invoked. However, nothing happens when I click on it. Here is the HTML component code: <div class="row m-0 justify-content-between" *ngFor="let i of k[currentk]?.details | keys"> <div (click ...

Here's a quick tip for adding a new line in your input message in Angular - just press Shift +

I need help with my chat box input field. I want it to be able to handle new line inputs similar to Facebook's chatbox. Here is a screenshot of My Chat Box: [1]: https://i.sstatic.net/NeG7d.png My HTML code for the input field: <form class=" ...

The divs are crashing into each other and moving at varying speeds

I have created a mini game inspired by diep.io on codepen, where you can upgrade your reload and shooting capabilities. However, I have encountered an issue where the bullets start moving at different speeds and end up overlapping each other after shooting ...

Retrieve the image and insert it using an img tag

Working on a project, I want to include Instagram profile pictures by embedding them. Although I have the image URL, I am struggling to integrate it into my HTML page. Take a look at this sample: This provided link displays the Instagram profile picture. ...

What is the best way to customize the small square area found between the vertical and horizontal scrollbars?

Please take a look at the images provided below: https://i.stack.imgur.com/QVHfh.jpghttps://i.stack.imgur.com/cubd8.jpg Whenever both vertical and horizontal scrollbars intersect, it results in a square space. This phenomenon occurs not just within the b ...

What is the best approach to extracting tightly-coupled code and converting it into an external library?

I have a question regarding paradigms that I would like to address, and if this is not the appropriate platform, please guide me to the right place. Your recommendations are most welcome :) Currently, I am tasked with extracting a significant piece of fun ...

generate a different identifier for ajax requests avoiding the use of JSON

The AJAX request functions in the following way: success: function(data) { $('#totalvotes1').text(data); } However, I need it to work with unique IDs as follows: success: function(data) { $('#total_' + $(this).attr("id")). t ...

Distinguishing Font Sizes in Safari Compared to UIWebView

When the page is loaded in Safari, everything looks perfect. However, when viewed in a UIWebView, all the fonts appear enlarged. I've done my research and tried various solutions like: - Setting WebView.scalesPageToFit = true - Applying default con ...

Ways to enhance the resilience of the max-width property when utilizing PHP calls or dynamic CSS styling

I attempted to customize the CSS in page builder mode by adding the following code: #content { max-width: 2000px; } While in page builder mode, the desired effect was achieved. However, once I published the changes, the page reverted back to the prev ...

The added class is not being successfully applied to the ClassList

I'm currently working on a page where I want the colors of a button and the background to switch when the button is clicked. document.querySelector("body.light").classList.toggle("dark"); document.querySelector("button.dark").classList.toggle("light" ...

Using Jquery and Ajax to retrieve data from a database with the help of PHP

I am facing an issue with my HTML page, it is too large to share but here is the ajax/jquery code I am working with to access PHP file variables. threadPage.html <script type="text/javascript"> $.ajax({ url : & ...