Create columns with responsive layouts that can accommodate multiple groups of images and paragraphs

Multiple divs with images and another group of divs containing p tags (only numbers) come together to create an odontogram. This structure, consisting of a set of teeth along with their corresponding numbers, fits within a column that is 8 units long. Moreover, this entire setup is enclosed in a bootstrap card. Each image is housed inside its respective div.

If you want to see the complete code, you can visit here. Additionally, here is a preview:

<div class="row">
<div class="col-md-8 odontograma">
    <div class="card">
        <div class="card-body">
            <br>
            <div class="pieceRow1">
                <p class="pieza18" id="pieza18">18</p>
                <p class="pieza17" id="pieza17">17</p>
                <p class="pieza16" id="pieza16">16</p>
                <p class="pieza15" id="pieza15">15</p>
                <p class="pieza14" id="pieza14">14</p>
                <p class="pieza13" id="pieza13">13</p>
                <p class="pieza12" id="pieza12">12</p>
                <p class="pieza11" id="pieza11">11</p>
                <p class="pieza21" id="pieza21">21</p>
                <p class="pieza22" id="pieza22">22</p>
                <p class="pieza23" id="pieza23">23</p>
                <p class="pieza24" id="pieza24">24</p>
                <p class="pieza25" id="pieza25">25</p>
                <p class="pieza26" id="pieza26">26</p>
                <p class="pieza27" id="pieza27">27</p>
                <p class="pieza28" id="pieza28">28</p>
            </div>
            <div class="fila1 d-flex justify-content-center">
                <div class="pieza18" id="img18"><img class="diente18" src="../../imagenes/caraDentalVacia.png" alt="">
                </div>
                <div class="mr-3"></div>
                <div class="pieza17" id="img017"><img class="diente17" src="../../imagenes/caraDentalVacia.png" alt="">
                </div>
                // More similar div structures here...
            </div>
        </div>
    </div>
</div>

I attempted applying the 'img-fluid' class to the images but it resulted in them being small and unresponsive. Is there any way to make the number-image combinations responsive within the column using bootstrap or CSS?

Answer №1

If you're looking to create an Ontogramm using HTML and CSS without relying on graphics or images, a grid layout can achieve that effect. However, for the grid to display correctly, it will need a minimum width of 720px. Below this threshold, issues may arise due to sizing constraints. Ideally, the grid should automatically adjust to different screen sizes and expand to its full width independently.

body {
  min-width: 720px;
  display: grid;
  grid-template-columns: repeat(17, 1fr);
  grid-auto-rows: auto;
  grid-gap: 2px;
  padding: 2px;
  text-align: center;
}

div {
  width: 100%;
  height: auto;
  padding: 0;
  margin: 0;
  object-fit: contain;
}
<body>
  <!-- 1st Row -->
  <div>18</div>
  <div>17</div>
  <div>16</div>
  <div>15</div>
  <div>14</div>
  <div>13</div>
  <div>12</div>
  <div>11</div>
  <div></div>
  <div>21</div>
  <div>22</div>
  <div>23</div>
  <div>24</div>
  <div>25</div>
  <div>26</div>
  <div>27</div>
  <div>28</div> 

  <!-- More Rows with Content Here -->

</body>

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

Invalid chunk type detected in createimagefromstring function

Having trouble finding a solution to my issue... so here goes: I have developed a SLIM webservice that allows users to upload reports containing one or more base64 encoded images. All the data received in my webservice functions is json-encoded, which I ...

Prevent the influence of other page styles on a div element

My question involves a browser extension that inserts a div element (along with others) into the page. Is there a method to prevent the page's styles from impacting the appearance of the elements I've added? One option I've thought about is ...

Integrating information from various sources to create a cohesive online platform

I am looking to incorporate data from various sources into a single web page: Social networks (Facebook, Twitter, LinkedIn, etc.) RSS feeds Article meta tags (particularly OpenGraph and Twitter cards) This data may change dynamically based on user inter ...

Swap a jQuery class with another if the class for ul li is currently active

I am currently developing a form builder and I would like to customize the appearance, specifically changing the color of the text. I want the text to be white when the class is set to active, and black when the class is not active. Is there a way to achi ...

Place a div box beneath another div box that is absolutely positioned, without requiring knowledge of its height

My website features an arrangement of pictures placed within div boxes and positioned absolutely to my liking. .char1 - .char5 are correctly positioned. Now, I am seeking a way to align .char6 - .char10 directly under .char1 - .char5. Is there a smart app ...

What is the best way to align inline-block elements in a straight row?

I am encountering an issue with the code block below: <div class="1"> Foo<br>1 </div> <div class="2"> Bar<br>2 </div> Even though both .1 and .2 have styles of position:relative;display:inline-block, they are displ ...

Change the color of all the text on a page to a designated shade

Is there a way to change the color of all text on a page to a specific color? I am dealing with user-generated content in HTML and CSS, making it impossible to control classes for specific elements. Given the wide variation in the page's HTML an ...

Preventing blank text entries in a task management application

Is there a way to determine if the text input provided by the user is empty or contains some text? I'm in the process of developing a TO-DO app and I'd like it so that if a user fails to enter anything into the text area and clicks on "add", the ...

Webpack struggles with handling css using the css-loader when trying to implement (react)-css-modules

Trying to set up webpack with react and (react)-css-modules, but encountering an issue where webpack is unable to parse the css. This is the standard configuration being used. const webpack = require("webpack"), merge = require("webpack-merge"), path ...

Having trouble centering an icon in a cell within AG Grid?

I am struggling with aligning my checkmarks within the cells of my AG Grid. Currently, they are all left aligned but I need them to be centered. Adjusting the alignment for text is not an issue, but I can't seem to center the material icons. It appear ...

Transitions fail to appear correctly when the page first loads

I need to fill a gauge meter based on a variable sent to the html file. To achieve this, I have initially set the value to zero: transform:rotate(.0turn); transition: all 1.3s ease-in-out; However, when the HTML is first loaded or refreshed (with F5 ...

How can CSS animations be implemented on a diagonal path?

I have developed a unique CSS animation that adds a shiny effect to text. Currently, the effect only works horizontally. I am interested in exploring options to change the direction of the animation to create a diagonal shine effect. Below is the code I a ...

AngularJS routing that is tailored to form input

I am trying to create a dynamic html page where the user can input form variables. My goal is to use AngularJS routing to navigate to different URLs based on the form inputs. Does anyone have advice or guidance on how I can achieve this functionality? ...

Text area with a set height and expandable max-height - scrollable overflow

http://codepen.io/africanmatt/pen/IcGpa .text { max-height: 0; overflow-y: auto; transition: all .45s ease-in-out; } .text-active { max-height: 50%; } I am looking for a way to resize the .text component's max-height so that it adjusts prop ...

Change the button text without the need for a click, automatically switch

How can I make a button switch between 'click here' and 'download' every 2 seconds without requiring user interaction? The code I've tried so far is below, but it's not working as expected: <div class="assetClass customBut ...

In Internet Explorer 7, a newline within a <pre> tag may cause display issues

Within my ASP.NET MVC 3 project, I am working with the following code: <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" ty ...

Design an interactive div element that allows users to modify its content, by placing a span

Here is an example of the desired effect: ICON LINE - 1 This is some sample text inside a div element and the next line should begin here ICON LINE - 2 This is some sample text inside a div element a ...

Tips for ensuring that 3 divs fill the height of their parent container

I'm facing an issue with 3 dynamic content divs inside a parent container. I want them to all have equal heights and fill the parent container. To demonstrate my problem, I've set up a simple example on jsfiddle. .parent { overflow: hidden; ...

The iPad1 is having trouble displaying the background image, while the iPad2 is showing it perfectly

I am experiencing issues with the background image on my website not displaying properly on an iPad 1, however it appears fine on an iPad 2. Does anyone have any suggestions or ideas on how to fix this? Thank you in advance. ...

Searching for text in a Python Selenium input field and retrieving suggested values can be achieved by using certain methods and commands

When you type a term like "apple" into the search bar on , a dropdown menu with search suggestions appears. https://i.sstatic.net/pGxzt.png I am attempting to retrieve a list, dictionary, or dataframe of the values in that dropdown box. For example: { ...