Challenges with Aligning Panels in Column 6

My initial encounter with bootstrap was interesting. I attempted to have two panels placed side by side using the col-lg-6 class. The left panel was meant to be a link to an article, along with an image, while the right panel would serve as a signup/login box. However, upon loading the site, the two panels ended up stacking underneath each other instead of appearing next to one another.

<div class="row">
            <div class="col-lg-6">
                <h2>Latest News</h2>
                <p>Article</p>
                <div class="panel panel-default">
                <div class="panel-heading">Panel Header</div>
                <div class="panel-body"><img class="img-responsive" src="images/warning.png"</div>
            </div>
        </div>
            <div class="col-lg-6">
                <form action="/action_page.php">
                    <h2>Buy, Sell and more deals!</h2>
                    <div class="form-group">
                        <label for="email">Email address:</label>
                        <input type="email" class="form-control" id="email">
                    </div>
                    <div class="form-group">
                        <label for="pwd">Password:</label>
                        <input type="password" class="form-control" id="pwd">
                    </div>
                    <div class="checkbox">
                        <label><input type="checkbox"> Remember me</label>
                    </div>
                    <ul class="nav navbar-nav navbar-center">
                        <li>
                            <button class="navbutton"> 
                                Login
                            </button>
                        </li>
                        <li>
                            <p> Not with us yet? </p>
                        </li>
                        <li>
                            <button class="navbutton"> 
                                Sign Up
                            </button>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </div>

All of this is enclosed within a container.

View image before adding it here

View image after adding it here

Answer №1

Feel free to utilize this HTML code snippet below:

<div class="row">
    <div class="col-lg-6">
        <h2>Breaking News</h2>
        <p>Article content goes here</p>
        <div class="panel panel-default">
            <div class="panel-heading">Panel Header Example</div>
            <div class="panel-body">
            <img class="img-responsive" src="images/notification.png"/>
            </div>
        </div>
    </div>
    <div class="col-lg-6">
        <form action="/action_page.php">
            <h2>Buy, Sell, and Discover Great Deals!</h2>
            <div class="form-group">
                <label for="email">Enter your email address:</label>
                <input type="email" class="form-control" id="email">
            </div>
            <div class="form-group">
                <label for="pwd">Create a password:</label>
                <input type="password" class="form-control" id="pwd">
            </div>
            <div class="checkbox">
                <label><input type="checkbox"> Remember me on this device</label>
            </div>
            <ul class="nav navbar-nav navbar-center">
                <li>
                    <button class="navbutton"> 
                                Sign In
                            </button>
                </li>
                <li>
                    <p> New to our site? </p>
                </li>
                <li>
                    <button class="navbutton"> 
                                Register Now
                            </button>
                </li>
            </ul>
        </form>
    </div>
</div>

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

The jQuery form validation feature surprisingly doesn't take into account the value of the submit button

I have implemented jQuery form validation from Here is an example from demo.html <form id="form-signup_v1" name="form-signup_v1" method="get" class="validation-form-container"> <div class="field"> <label for="signup_v1-username">Fir ...

"Enhance your ASP.NET site with a captivating background

I am currently working with C# in VS2005. My challenge is to add a background image to my login page, which is in the form of an .aspx file. Here is a screenshot of my current setup: Here is the code snippet for my background: <div align="center" ...

Is the table row changing in size when a filter script class is applied?

When trying to filter table rows by category and adding the class filterTr to the element <tr>, I noticed that the width of the <tr> element changes, causing it to no longer align with the <th> element above. I am unsure why this resizin ...

Outputting PHP Array as an HTML Table

I need help displaying products from a specific category in an HTML table with only three columns. My current code is: <table> <?php $catagory=$_GET["q"]; $con = mysql_connect("localhost","cl49-XXX","XXX"); if (!$con) { die('Co ...

6 Steps to Extract Data from a POST Request Using JavaScript

I have a form that includes a text field and a select field. When the form is submitted, I am posting it. Can someone guide me on how to extract the form data on the server using JavaScript? <form id="createGameForm" action="/createGame" method="post" ...

Aligning container divs at the center in various screen resolutions

I recently constructed a portfolio website using Bootstrap and Isotope JS. In my layout, I have a container div which works perfectly when viewed on a desktop browser - displaying 3 divs in one line. However, the issue arises when the resolution changes an ...

Implementing CSS styles with jQuery

Looking for a way to dynamically add CSS attributes to different form elements like text fields, text areas, checkboxes, and dropdowns? There's also a separate block that lists possible CSS properties such as font, font-style, width, and padding. What ...

Creating a pull-up toolbar with just HTML and CSS for an Android browser

I need to create a draggable toolbar on my mobile webapp that can reveal content beneath it. I want to achieve this using just HTML/CSS, without relying on touch/scroll events or libraries. To do this, I'm overlaying a scrolling element on top of the ...

Modifying the weight of fonts in TVML components

Currently, I'm in the process of developing a TVML app specifically for the Apple TV. Lately, I've been experimenting with making some style adjustments to various elements within the app. Following the guidance provided in the TVML documentatio ...

The Selenium python tool is reporting that the element at coordinates (X, Y) is not clickable, as another element is blocking it from receiving the click. It's important to note that

Here is a link to an online store that I need to extract information from. Specifically, I am looking to access the Most Helpful, positive, negative, most recent, and certified buyers' sections in order to scrape the values within them. Unfortunately, ...

Center the cropped image within a div container

Is there a way to set a maximum height for a div containing an image and hide the parts of the image that exceed this height, while keeping it centered vertically inside the div? For example, if the browser width is 1200px and the image aspect ratio is 4:3 ...

jquery modal not displaying

My page is designed to display a dialog containing a set of guidelines using a PHP script that determines which guideline(s) should be shown and generates the corresponding div element(s). Afterwards, I utilize a simple $(document).ready( function() { $(" ...

Are conditional comments truly the best approach? What is their functionality and operation like?

A previous question addressing a div positioning issue in Internet Explorer received multiple suggestions advising the use of conditional commenting Why is this relatively positioned div displaying differently in IE? How does one implement conditional co ...

Getting the nth-child rule for CSS in IE9 to function properly in IE8

This code is functioning in IE9: body.country-XYZ .abc:nth-child(3) { display:none; } As :nth-child() is effective in IE9 and newer versions, what can be done to ensure it also functions on IE8? Can you suggest an alternative method for achieving th ...

A combination of fixed width column and dynamic content area in Bootstrap design

Is there a way to achieve the combination of fixed and fluid width columns using Twitter Bootstrap alone, similar to this example? The HTML and CSS in the example make it seem simple. But can this be done solely with Bootstrap? ...

By checking the active box and completing the fields, the button will be activated

I'm currently working on a form that requires all fields to be filled out and the acceptance checkbox to be checked before the Submit button becomes active. If any entry or the checkbox is subsequently removed, the button should become inactive again. ...

The Surprising Nature of <div> when containing <a> (anchor tags)

There are 3 div elements on a page. div { display: inline-block; margin: 10px; width: 200px; height: 200px; background-color: #333; color: white; text-align: center; } <div></div> <!--Div ...

Ways to hear a variable using Google Translate

We're utilizing HTML5 and Javascript. Imagine we have a list containing the names of all players from Barcelona (for example, name = 'Lionel Messi'). I want to make the player's name audible. To achieve this, I would use: var narrator ...

Tips on customizing the selected icon color in Material-UI's BottomNavigationAction styling

I'm facing an issue with Material-UI styled components and could use some assistance. My goal is to create a BottomNavigation bar in React using Material-UI v5 where the selected option's icon displays in red (#f00) while the unselected icons sho ...

Conceal elements on smaller screens using the Bootstrap 5 grid system

I'm facing a design issue with my layout - it looks perfect on larger screens but when viewed on mobile devices, the columns stack vertically instead of horizontally. Essentially, I want to hide the first and second last column on small screens and r ...