Creating borders for two columns as a complete unit in Bootstrap 3

To see a preview of my codes, take a look here (on Bootply).

This is how the HTML section appears:

<div class="container">
  <div class="row">
    <a href="#a">
      <div class="my-border">
        <div class="col-md-3">A</div>
        <div class="col-md-3">A1</div>
      </div>
    </a>

    <div class="my-border">
      <a href="#b">
        <div class="col-md-3">B</div>
        <div class="col-md-3">B1</div>
      </a>
    </div>

  </div>

</div>

Here is the CSS part:

.my-border
{
  border: medium double rgb(250,0,255)
}

I am trying to achieve borders like this:

-----------
|A A1|B B1|
-----------

However, I am experiencing issues with the borders not displaying correctly. Additionally, I have two more inquiries:

  1. Would it be acceptable to nest a

    <div class="my-custom-class">
    within <div class="col-xx"> and <div class="row">? If not, what would be the recommended approach?

  2. Is it considered appropriate to wrap an <a href="my-custom-link"> around multiple <div>s? If not, what alternative method should be used?

Thank you!

Answer №1

Ensure that you correctly specify the point for my-border class, and be sure to include the content of columns inside the cols divs.

You can also expand the columns divs using your border class.

Take a look here: http://www.bootply.com/73dXGqF2i5

Answer №2

Check out this helpful Solution

CSS Suggestions:

.my-border {
  border: medium double rgb(250,0,255);
}

HTML Structure:

<div class="container">
  <div class="row">
    <center>
      <a href="#a">
        <div class="my-border">
          <div class="col-md-3">A</div>
          <div class="col-md-3">A1</div>
          <a href="#b">
            <div class="col-md-3">B</div>
            <div class="col-md-3">B1</div>
          </a>
        </div>
      </a>
    </center>
    <br>
    <div class="my-border">
    </div>
  </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

Transferring HTML table information to Django models for efficient data management

I am currently developing a student attendance management system using the Django framework. The objective is to fetch all the names of the students from the student database and display them in an HTML table. Additionally, I will be updating the informati ...

Definitions that are displayed dynamically when hovering over a particular element

I am seeking a way to implement popup definitions that appear when a div is hovered over. My website showcases detailed camera specifications, and I want users to see a brief definition when they hover over the megapixel class called '.mp'. One o ...

How can one conceal all li elements except for one during a loop on Vue.js version 2.6.11?

To provide a better understanding of the problem, I have included screenshots of the layout. Static Layout Layout when question was clicked There are multiple questions that will be displayed through a loop. Each question is contained within an li tag. ...

Encountering an issue stating "The element is not visible at the moment, therefore cannot be interacted with" while trying to access a text box within a window opened via an ajax call

Currently, I am working on a Selenium script using Java to automate a specific process. However, I have encountered an issue where clicking on a dropdown causes a hidden popup to appear through an ajax call. Unfortunately, when attempting to interact with ...

Capture the beauty of Safari with images displayed in the input file element

I'm facing an issue with the file upload element on my website. Most browsers, like Chrome and FF, display the image name when a file is chosen. However, Safari seems to show a tiny thumbnail instead. My goal is to create a custom upload button that ...

This piece of code is causing my browser to lag

I am encountering an issue with fetching and adding values from a weather API to my HTML elements. My goal is to display the hourly forecast for today, starting from the current hour until midnight of the next day. In order to optimize space, I implemente ...

In Chrome, the computed style of background-position is returned as 0% 0%

Let's say I have an element and I am interested in finding out its background-position: To achieve this, I use the following code snippet: window.getComputedStyle(element).getPropertyValue('background-position') If the value of background ...

What is causing the QJsonValue(undefined) to be returned?

After sending a request to the API for bid price, I am receiving an undefined QJsonValue and unable to display it later. Can anyone help me pinpoint where I might be going wrong? { QApplication a(argc, argv); MainWindow w; w.show(); QNetwor ...

Guide on selecting a default value in a Datalist Dropdown in Angular

In my editable dropdown, I am looking to automatically populate the default value from a template. The default value is sourced from "this.Model.Application.environment" which contains "dev" as the value. The current code provides an editable dropdown, b ...

Save hyperlinks in a storage system

I need to store an article in a MongoDB database, and some words within the article should be clickable links leading to other pages. However, when I display the article using an EJS template, the anchor tags I added while writing the article appear as pl ...

Creating a dynamic element in real-time with CSS

I need help with a styling issue involving multiple spans enclosed in a center tag. I want each span to enlarge when hovered over by a user, but the problem is that when I increase the size of one span, it pushes aside all the other elements and disrupts t ...

Having trouble with Python Bottle <br /> not functioning properly?

I encountered a perplexing issue and I am unsure of how to resolve it: There is a text area where users can input their text. For example, let's say the following is entered : This is the user's text After storing this in my database and ret ...

Divide the text: send a few to the left and the rest to the right

Looking for a way to split text in list elements? You can use the following code: |Foo..............Bar| Where | represents the element boundary, and . indicates white space. The code snippet is as follows: <li><span class="left">Foo</spa ...

Using Bootstrap 3's hidden-xs class can help slim down the width of

I am currently testing out the Bootstrap 3 responsive grids and attempting to hide a column from a row when the screen size is small. However, I find that when the column disappears, the entire row seems to shrink in width. Here's the code causing me ...

Ensure uniform height for all floating DIVS

Problem Description I'm facing an issue with the columns in my footer. I have a total of four columns, and I've applied the border-right property to all of them except for the last one: Due to varying content and height in each column, I am una ...

Tips for recalling the display and concealment of a div element using cookies

My HTML code looks like this: <div id='mainleft-content'>content is visible</div> <div id="expand-hidden">Button Expand +</div> To show/hide the divs, I am using JQuery as shown below: $(document).ready(function () { ...

Transitioning Opacity in CSS

I found inspiration for my project from the following source: https://codepen.io/plavookac/pen/qomrMw One challenge I'm facing is changing the opacity of the movement, which is not covered by the standard transition markers. .mainInner{ display ...

When hovering over, my text and image shift to the left in a strange and abnormal manner

Recently, I made a small code addition to an existing one in order to display text below an image and have the text highlighted in blue on mouse over. Everything seemed to be working fine until I noticed that on mouseover, the text and image shifted to the ...

What is the best way to transition a div from the top to the bottom in mobile view?

Currently, I am utilizing Bootstrap 4 framework; however, if it operates effectively on version 3, then it should work seamlessly on v4. Within a single column, I have incorporated 2 div elements as follows: <div class="row"> <div class="col ...

Expanding the width of an image beyond its parent <div> without compromising on vertical space

Is it possible to have a child <img> wider than its parent div, while maintaining proportional width and preserving vertical space? Using position:absolute; might move the image out of the normal document flow, but I want to keep the vertical space ...