What are the best techniques for recreating the "Price Compare" responsive card layout?

Comparison of Plans on Desktop:

https://i.sstatic.net/fzTeOJF6.png

Mobile Plan Comparison:

https://i.sstatic.net/2FBEmdM6.png

Hello there,

I'm seeking suggestions for designing this particular section of the layout. This section is visible both in desktop and mobile versions, as shown in the images above.

It showcases a price comparison "table". I am not only exploring ways to visually present this information but also considering how it will be interpreted by screen readers.

The major differences between the desktop and mobile versions are that the "Compare Plans" heading moves up, leaving an empty space beneath it, the spaces between columns decrease to fit mobile screens, and scrolling becomes necessary.

Initially, my approach involved nesting three columns inside a larger container using grid or flex. However, I faced challenges such as inconsistent border bottoms on rows and uncertainty about rearranging headings.

Later, I received a suggestion to avoid nesting elements and simply place all items within the parent container, utilizing grid for positioning and adjusting the layout with media queries for smaller screens.

I'm unsure about the effectiveness of this approach and whether it might cause issues for screen readers due to potential HTML structure limitations.

Another consideration was incorporating a table format, but I'm uncertain about the feasibility of this method, especially when reorganizing headings for the mobile version.

I would greatly appreciate any recommendations you may have.

Thank you for your input.

I have attempted to organize my layout into three columns.

Answer №1

Add the title 'Compare Plans' above the comparison table. Include the same title within the first <th> tag inside the table.

<h2 class="headingMobile">Compare Plans</h2>
<table>
   <th>
       <h2 class="headingPC">Compare Plans</h2>
   </th>
   <th> basic..</th>
...

Adjust the styling to eliminate any unnecessary spacing, etc.

Utilize a media query with display: none; to toggle visibility based on the desired heading display.

An alternative method involves using the visibility property along with pointer: none, although keep in mind that these elements will still exist in the DOM and be recognized by most screen-readers.

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 error code 13:5 indicates that the "Home" component has been registered in the Vue application but is not being used, leading to the error message "vue/no-unused-components"

I encountered this issue while working with Vue for the first time. I was attempting to construct a website using Vue/CLI by reorganizing and building from the inside out. However, I am unfamiliar with Vue and unsure how to resolve this error. The changes ...

Iterate through a directory on the local machine and generate elements dynamically

I am looking to create a jQuery-UI tabs menu that includes 54 images on each tab. I have a total of 880 images stored in a folder, and it would be very time-consuming to manually insert an <img> tag for each one. Is there a way to dynamically cycle t ...

Interactive Vue.js canvases that adapt and respond to various

I am currently working on adjusting my canvas to fit within its container in a Vue component. When I call resizeCanvas() in the mounted hook, I notice that the container's height and width are both 0. How can I create a canvas that dynamically fits it ...

How to Implement Multiple Selection in Laravel with HTML?

We are in the process of designing a dropdown menu using Laravel as shown below: {{Form::select('job_location_id', $jobLocationList, '', ['class' => ...

What is the most efficient way to implement OR conditions in JavaScript for shorter code

Hello there! I have a question about optimizing conditions in code. Is there a more elegant way to write the following conditions? state === 'su' || state === 'ja' || state === 'fa' I was thinking if it could be simplified ...

The process of binding two variables in the same select element

Here is the code snippet that I am working with: <div class="form-group "> <label for="field_type"><b>Type</b></label> <div class="input-icon right"> <select required class="form-control" ...

Tips for expanding a flex-grow element to fill the area of a concealed flex item

I am looking to create a window that can be divided into two or three areas based on the state of a checkbox. When the box is checked, I want the second area to be hidden and the first area to expand to fill the additional space. My layout works perfectly ...

Swapping stylesheets using a hyperlink - a simple guide

Currently, I am creating a website that utilizes PHP, XHTML strict, and jQuery. The main goal is to ensure the site is adaptable for mobile and desktop devices by implementing the principles of Responsive Web Design. This involves serving different stylesh ...

The intricate layout of an HTML Bootstrap table

Struggling to create a complex table structure using BOOTSTRAP and need some help. If anyone has the solution or HTML structure to share with me, that would be greatly appreciated. Here is a screenshot of the structure I am aiming for:) Thank you in adva ...

"Exploring the Possibilities of iOS Webview with jFontSize

Trying to use jFontSize on a local html page displayed in a WebView, allowing users to change text size. However, adding breaks the script's functionality. Even with another script, the issue persists. HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD ...

Is there a way to create submit buttons that trigger printing in HTML? Additionally, how can I design a text input that spans 100% width on the same line as a <span>, <p>, or <div>?

These are the files I have: .dir { color: white; font-family: "Lucida Console", Monaco, monospace; font-size: 16px; } .cmdline { font-family: "Lucida Console", Monaco, monospace; background-color: black; border: 1px solid black; color: whi ...

Customize cell options in a dynamic grid within a dojo environment

When I double click on a cell in a data grid, I want to display a dropdown with information from a dojo store. However, the code I am using is not working as intended. I need to show clinician IDs stored in "clinStore" in the 'clinicianId' field ...

Adjusting the panel dimensions based on the screen size

One feature on my website is a sliding panel (Image 1) located on the right side. It appears and disappears when a button is clicked, covering the entire height of the screen.https://i.sstatic.net/dF5Zc.jpg Here's the CSS code for this sliding panel- ...

Attempting to align two distinct divisions next to each other

Here is the updated code snippet: <Grid container justify="space-between" alignItems="flex-start" direction="column" xs spacing={5} style={{ padding: 10, }}> <ParamSelection/> { state.select ...

The button's unclickability is due to the zIndex being set to -1

How can I create a clickable button? https://i.sstatic.net/BXOjz.png Feel free to check out the sandbox example here: https://codesandbox.io/s/m5w3y76mvy ...

Tips for organizing and concealing images within a Div for seamless transitions (no need for floats)

Currently, I am working on a grid layout for my website. My goal is to have 9 images load quickly, and then once the page has loaded, I want to fetch additional images, insert them into the image containers, and animate between them. While I understand how ...

How come it's so difficult to set the perspective camera to accurately display sizes in three js?

Currently, I am using Three Js to create a visual representation of a car. However, I am encountering an issue with the perspective camera that I can't seem to resolve. My goal is to make it appear more realistic by only showing the front of the car, ...

Bootstrap dropdown menu fails to adapt to updated navbar height

I recently made a modification to the navbar size on my website, increasing it from 50px to 63px by tweaking a line in the bootstrap.css file. The exact code snippet I utilized for this adjustment is as follows: .navbar { position: relative; min ...

Navigating to a different page in the app following a document update: a step-by-step guide

I am facing an issue with a page where I am trying to print a specific DIV using the script below... function printReceiptDiv() { var divElements; if (vm.isDLR) { divElements = document.getElementById("DLRreportCont ...

Adjust the width of a div in Angular 6 based on a specified condition

I need to adjust the width of a div based on certain conditions. <div [ngStyle]="'width': selectedTab =='Home' ? '50%' : '100%'"> </div> The currently selected tab is stored in "selectedTab". There ...