Ways to showcase a list in 3 columns on larger screens and 1 column on smaller screens

When viewing on a computer, my list appears like this: https://i.sstatic.net/fNhaP.png

However, when I switch to a phone, only the first column is visible and the list does not continue in a single column format.

I am utilizing Bootstrap for my layout, and here is a snippet of my code:

 <section>
        <div class="container">
            <div class="row align-items-start">
                <div class="col-sm-12 col-md-4">
                    <div class="p-3">

                        <b>Statewide Texas Sites</b><br />
                        <a href="https://www.touringtexas.com/" target="_top">Touring Texas</a>
                        <br />
                        <a href="https://www.texas-lakes.net/" target="_top">Texas Lakes</a>
                        <br />

                    </div>
                </div>

                <div class="col-sm-12 col-md-4 col-md-push-4">
                    <div class="p-3">

                        <b>Texas Tourist Areas</b><br />
                        <a href="https://www.highlandlakes.com/" target="_top">Highland Lakes</a>
                        <br />
                        <a href="https://www.hill-country.net/" target="_top">Hill Country Network</a>
                        <br />

                    </div>
                </div>


                <div class="col-sm-12 col-md-4 col-md-push-4">
                    <div class="p-3">

                        <b>Texas Lakes</b><br />
                        <a href="https://www.highlandlakes.net/lakeaustin/" target="_top">Lake Austin</a>
                        <br />
                        <a href="https://www.lake-bridgeport.com/" target="_top">Lake Bridgeport</a>
                        <br />

                    </div>
                </div>
            </div>
        </div>
    </section>

Answer №1

It seems like there might be an issue with your configuration as the code should work properly. One thing to check is the viewport settings - ensure that you have

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
in your head section.

Test the example on both mobile and desktop interfaces to confirm functionality.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="/docs/4.1/assets/img/favicons/favicon.ico">

    <title>Sticky Footer Template for Bootstrap</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<body>
<section>
<div class="container">
<div class="row align-items-start">
<div class="col-sm-12 col-md-4">
<div class="p-3">

<b>Statewide Texas Sites</b><br />
<a href="https://www.touringtexas.com/" target="_top">Touring Texas</a>
<br />
<a href="https://www.texas-lakes.net/" target="_top">Texas Lakes</a>
<br />

</div>
</div>

<div class="col-sm-12 col-md-4 col-md-push-4">
<div class="p-3">

<b>Texas Tourist Areas</b><br />
<a href="https://www.highlandlakes.com/" target="_top">Highland Lakes</a>
<br />
<a href="https://www.hill-country.net/" target="_top">Hill Country Network</a>
<br />

</div>
</div>


<div class="col-sm-12 col-md-4 col-md-push-4">
<div class="p-3">

<b>Texas Lakes</b><br />
<a href="https://www.highlandlakes.net/lakeaustin/" target="_top">Lake Austin</a>
<br />
<a href="https://www.lake-bridgeport.com/" target="_top">Lake Bridgeport</a>
<br />

</div>
</div>
</div>
</div>
</section>

  </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

Is it possible to achieve this shaded gradient effect using CSS3?

Check out this image for reference. I've managed to style a horizontal rule using SVG as the background image, creating a specific effect. However, I am struggling to achieve the same result using CSS3 alone. If there are any CSS experts who can adv ...

Steps for adding a navbar that slides horizontally and overlaps other links on a webpage

I am attempting to design a sliding navigation menu using JQuery. The concept involves having multiple main sections, each with several subsections. When a user hovers over a section, the subsections will expand horizontally. If another section is current ...

When selecting a new tab in HTML, the current page position remains unchanged. However, I would like the page to automatically scroll to the

In the design of my website, I have incorporated buttons that are linked to various pages using navigation tabs. However, when these buttons are clicked, the view maintains its position on the new page (e.g., halfway scrolled through the page). Instead o ...

Transferring previously obtained data to templateProvider within AngularJS

I'm currently working with AngularJS 1.3 and UI-Router. I have a state set up with a resolve and a templateProvider. My goal is to utilize the data fetched from the database in the resolve within the templateProvider without having to make duplicate ...

The concept of an undefined property

I encountered this error in my console: index.js:70 Uncaught TypeError: Cannot read property 'searchForm' of undefined at eval (index.js:70) at Module../src/js/index.js (bundle.js:4245) at __webpack_require__ (bundle.js:20) at e ...

Create an index.html file using webpack to utilize it with the development server

Using webpack to run my Three.js application, I have the following configuration in the webpack.config file: module.exports = { entry: `${__dirname}/src/tut15.js`, output: { path: __dirname + '/dist', filename: 'index_bundle.js&a ...

Learn how to utilize JavaScript produced by the `webpack output library` in a `nodejs` application

I'm currently utilizing webpack to bundle my JavaScript into a library that serves two purposes: one for browser usage and the other for integration into Node.js applications. Below is a snippet of my webpack configuration: output: { filename: ...

Attempting to remove certain characters from a given string

let currentDate = new Date(); currentDate.toLocaleString; If I were to console log the value of currentDate, it would show: Wed Oct 16 2019 15:57:22 GMT+0300 (Israel Daylight Time) However, what if I only want to display the minutes and seconds like 57: ...

Tips for creating line breaks in Google Chart tooltips

I'm having trouble breaking a line in the code snippet below. Here is the complete code: <html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script ...

Improving User Experience with HTML Form Currency Field: Automatically Formatting Currency to 2 Decimal Places and Setting Maximum Length

Hello there, I am currently facing an issue with the currency auto-formatting in a deposit field on my form. The formatting adds 2 decimal places (for example, when a user types 2500, the field displays 25.00). However, the script I wrote does not seem to ...

Issue with VueJS where changes made to properties in the mounted hook do not properly trigger the

I'm working on a VueJS component that features a button with computed properties for its class and text. These properties change every time the button is clicked, updating smoothly with each interaction. However, I've encountered an issue when at ...

What is the best way to conduct automated tests on CSS rendering across various browsers, including Safari Mobile and the Android Browser?

Is there a way to programmatically and automatically test how CSS is rendered in various browsers, similar to how Selenium tests HTML and Javascript across different browsers? It would be great to integrate this with a BDD framework. ...

Steps for accessing CSS variables within a scoped style block in Vue with Buefy_integration

After diving into the Buefy documentation, I successfully personalized my color scheme and even crafted unique hues by applying the is-[colorName] as a class to HTML elements. <style lang="scss"> // Importing Bulma's core @import "~bulm ...

Angular2 allows you to create pipes that can filter multiple values from JSON data

My program deals with an array of nested json objects that are structured as follows: [{name: {en:'apple',it:'mela'}},{name:{en:'coffee',it:'caffè'}}] I am looking to implement a pipe that can filter out objects b ...

Tips for displaying lesser-known checkboxes upon clicking a button in Angular

I have a form with 15 checkboxes, but only 3 are the most popular. I would like to display these 3 by default and have an icon at the end to expand and collapse the rest of the checkboxes. Since I'm using Angular for my website, I think I can simply ...

Experiencing an issue where the canvas element fails to render on mobile Chrome browser,

I've encountered an issue with a script that draws a canvas based on the background color of an image. The image is loaded dynamically from a database using PHP. The responsive functionality works fine on mobile Safari, but not on Chrome. When the re ...

Restrict page scrolling to the vertical position of a specified div [Using jQuery, javascript, and HTML]

Currently, I am in the process of developing a personal website that features numerous expandable items. My goal is to restrict the page scrolling to the height of the expanded item once it is opened. I do not want users to be able to scroll above or below ...

Having trouble with jQuery animate function?

I have been struggling to get my animate function to work, despite looking at multiple similar posts and making modifications to my code. My goal is to make an image of a plane move from left to right across the screen and stop halfway. Here is the code I ...

Restrict printing loops within the designated division layer

Is there a way to limit the number of rows displayed horizontally when using foreach? I only want to display 7 rows. Can this be achieved with CSS or pagination? Here is an image illustrating the issue: https://i.sstatic.net/yJx3N.png Currently, it print ...

Ways to center a vertically aligned SVG in relation to text using Bootstrap

After experimenting with bootstrap, I have encountered an issue where I cannot vertically center an inline SVG relative to text. Below is a simplified example showcasing this problem: <!DOCTYPE html> <html> <head> <link rel=& ...