Dynamic Website Layout Bootstrap 4 [ card designs and Tabs ]

Currently, I am in the process of developing a web application that needs to be responsive across various devices including mobiles, tablets, and PCs. My focus right now is on creating a user profile page that adapts well to different screen sizes. To achieve this, I have utilized a grid system to structure the page.

Here's a snippet of the code for reference: Computer

<html>
<head><title></title>
<link rel="stylesheet" type="text/css" href="..\Styles\profile.css">
<link rel="stylesheet" type="text/css" href="..\Styles\nav-navbar.css">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
...

<p>The challenge lies in optimizing the layout for smaller screen devices like smartphones and tablets. The current display does not meet my intended design. Here is a screenshot illustrating the issue:
<a href="https://i.sstatic.net/O0gO6.png" rel="nofollow noreferrer">android Device</a></p>

<p>I aim to center the tab panel on the screen, ensure the content is responsive, place the [Name Tag] below the profile picture, and center the image on the screen. Despite several attempts, including restructuring elements within the card using rows and the class <strong>justify-content-md-center</strong>, I have yet to achieve the desired result.</p>

<p>CSS File: <strong>(profile.css)</strong></p>

<pre><code>body{
/*background-image:url("images/2.png");*/
background-color:rgba(26, 26, 26, 0.3) !important;
background-repeat:repeat;
}

@font-face {
    font-family: "hana";
    src: url("../fonts/hana.ttf");
}

...

Answer №1

Utilizing Bootstraps Responsive classes can simplify the handling of sizes for you. Here is an updated version of the snippet you provided, designed to assist you with your needs.

<div data-v-c06aa6da="" class="container"><div data-v-c06aa6da="" class="row"><div data-v-c06aa6da="" class="col-12 col-md-3"><div data-v-c06aa6da="" class="card" style="height: auto;"><div data-v-c06aa6da="" class="text-center"><img data-v-c06aa6da="" src="https://api.adorable.io/avatars/285/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="660704091212260702091407040a0348160801">[email protected]</a>" alt="Avatar" class="img-thumbnail mt-4" style="width: 14rem; height: 12rem;"><h2 class="text-center"><a data-v-c06aa6da="" href="">Admin</a></h2></div><div data-v-c06aa6da="" class="row justify-content-md-center"><div data-v-c06aa6da="" class="col-sm-9"><svg data-v-c06aa6da="" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true" class="octicon octicon-location"><path data-v-c06aa6da="" fill-rule="evenodd" d="M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"></path></svg><input data-v-c06aa6da="" type="submit" value="متابعة" class="btn btn-success btn-sm btn-block"><br data-v-c06aa6da=""></div></div></div></div><div data-v-c06aa6da="" class="col-12 col-md-9"><div data-v-c06aa6da="" class="card ml-1 ml-md-5" style="width: auto; height: auto;"><ul data-v-c06aa6da="" class="nav nav-tabs nav-fill"><li data-v-c06aa6da="" class="nav-item gu"><a data-v-c06aa6da="" herf="#" class="nav-link active"> عن الشركة</a></li><li data-v-c06aa6da="" class="nav-item gu"><a data-v-c06aa6da="" herf="#" class="nav-link">اخر الدرفتات</a></li></ul></div></div></div></div>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" />
    <title>Document</title>
</head>
<body>
  <div data-v-c06aa6da="" class="container"><div data-v-c06aa6da="" class="row"><div data-v-c06aa6da="" class="col-12 col-md-3"><div data-v-c06aa6da="" class="card" style="height: auto;"><div data-v-c06aa6da="" class="text-center"><img data-v-c06aa6da="" src="https://api.adorable.io/avatars/285/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1372717c67675372777c6172717f763d637d74">[email protected]</a>" alt="Avatar" class="img-thumbnail mt-4" style="width: 14rem; height: 12rem;"><h2 class="text-center"><a data-v-c06aa6da="" href="">Admin</a></h2></div><div data-v-c06aa6da="" class="row justify-content-md-center"><div data-v-c06aa6da="" class="col-sm-9"><svg data-v-c06aa6da="" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true" class="octicon octicon-location"><path data-v-c06aa6da="" fill-rule="evenodd" d="M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2 1.11 0-2-.89-2-2 0-1.11 1.89-2 2-2 1.11 0 2 .89 2 2z"></path></svg><input data-v-c06aa6da="" type="submit" value="متابعة" class="btn btn-success btn-sm btn-block"><br data-v-c06aa6da=""></div></div></div></div><div data-v-c06aa6da="" class="col-12 col-md-9"><div data-v-c06aa6da="" class="card ml-1 ml-md-5" style="width: auto; height: auto;"><ul data-v-c06aa6da="" class="nav nav-tabs nav-fill"><li data-v-c06aa6da="" class="nav-item gu"><a data-v-c06aa6da="" herf="#" class="nav-link active"> عن الشركة</a></li><li data-v-c06aa6da="" class="nav-item gu"><a data-v-c06aa6da="" herf="#" class="nav-link">اخر الدرفتات</a></li></ul></div></div></div></div>

</body>
</html>

insert code here

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

Enclose an <img> tag within a <span> element and use jQuery to assign a class to the <span>

I am trying to wrap a specific <img> tag with a <span> element and assign a class to the <span>. Below is the relevant code snippet: <img id="wrapped-image" alt="" src=""> Despite my efforts, the following code does not seem to w ...

Troubleshooting Layout Problems in HTML and CSS

My goal is to build a straightforward webpage template with 3 distinct sections: a header with two columns, a main body, and a footer. Here's the layout I've been working on: <div id="wrapper"> <div id="header"> <heade ...

The dialog box is not taking up the full width of the browser window

I'm facing an issue with a dialog box that only occupies a portion of the browser width, despite having a width set to 100%. The backdrop, however, extends across the entire width. //App.js import React from "react"; import ConfirmationDial ...

Trouble with parseJSON when handling form POST in Python

I'm struggling with a javascript HTML page that has an action POST to a python file, expecting a JSON response back. Despite my efforts, I can't figure out how to catch and parse the JSON data. The HTML and python code excerpts below should show ...

I desire to share the JSON information and receive the corresponding response data

<!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> ...

Adjust the height of a sibling div using JavaScript with mouseover event

I need assistance with creating an audio visualizer effect where on mouseover, "this" div becomes the tallest one and the other divs adjust their heights accordingly. How can I specify the specific height for each sister div to change to? Code window ...

The Kendo Dropdownlist mysteriously disappears behind the PDFViewer when using Safari

Currently, I am immersed in a project based on the MVC framework and utilizing the Kendo DropDownList. An problem has arisen, which is visualized in the image below. Specifically, the items of the Kendo DropDownList are becoming obscured by the PDFViewer ...

XMLWorker: unable to align cell vertically properly

Upon reviewing this code snippet: <table> <tr> <td border="1"> <table> <tr><td>Blah</td></tr> <tr><td>Blah</td></tr> ...

The JS content failed to load into the HTML page

I need help creating a workout tracker using two JS files. The main.js file is responsible for loading content from the second file (workoutTracker.js) into the index.html. However, I'm facing an issue where the content is not being displayed on the p ...

What is the best way to transform Adobe XD designs into HTML and CSS with Vue.js?

I am looking to create a single page application with vue.js and came across this helpful reference at . A colleague has created a prototype using Adobe XD, and now my task is to transform it into HTML/CSS while making it functional and connecting it to an ...

Issue with Jquery addClass method in Firefox

I am encountering an issue with the jQuery addClass() function in Firefox where the class is not being added to the current element. Interestingly, this code works perfectly in Chrome and Safari (IE has not been tested). Here is the CSS snippet : $(doc ...

My confusion is running high when it comes to navigating the mobile version of my website

Creating a navigation bar for my website has been challenging. Whenever I switch to mobile view, the list in my navigation bar shifts 40px to the right side of the screen where there's nothing. Is there any way you can assist me with this issue? ...

The alignment of the rows and columns is off, causing the image to shift onto a separate row altogether

Struggling to configure the header section of my website, specifically dealing with the mobile class. I'm attempting to set up a col-xs-7 with an h1 tag and two p tags, along with a col-xs-5 containing an image. However, the col-xs-7 is taking up the ...

Eliminating an SVG component from the webpage with the help of jQuery

Utilizing jQuery to insert an element into an embedded SVG can be achieved with the following code: var rect = SVG('rect'); $(rect).attr( { x: left, y: top, width: right - lef ...

How to apply a custom CSS class to a Smarty tag in CMS Made Simple

Greetings! I am currently in the process of revamping a page using CMSmadesimple, However, I have limited knowledge when it comes to utilizing CMSms and Smartytags. The page contains various smartytags that require styling. One particular tag that needs ...

Step-by-step guide to creating a pop-up div that appears on hover and remains visible when clicked

I'm trying to figure out how to make a popup appear when the mouse hovers over it and then stay visible when clicked on. The issue I'm facing is that currently, the popup disappears when the mouse moves away from it. How can I modify the code so ...

What is the contrast between specifying a MIME type and omitting it?

If I were to write a stylesheet in an HTML document, it's worth noting that since the introduction of HTML5, the type attribute is no longer necessary as text/css has become the default and only possible value: <style type='text/css'> ...

I can't seem to figure out the source of this unexpected padding/margin on my website

After creating a website for a church using Foundation, SASS, and Compass, I noticed a horizontal scroll issue when resizing the window. Adding overflow-x: hidden; seemed to fix it, but there was still about 20px of padding on the right side when testing ...

What is the process for adding text before and after a Bootstrap progress bar?

I want to customize the bootstrap progress bar with text at the beginning and end, like this: 5 star ----------------------------------------------- 70% Here is my attempt to achieve this: <link rel="stylesheet" href="https ...

JavaScript date formatting without using jQuery

Looking for help to apply a date mask (dd/mm/yyyy) on an ASP.net textbox. I have tried several JavaScript solutions found through Google search, but none seem to work seamlessly, especially with backspacing. Any suggestions for a reliable script would be ...