What are some strategies for maintaining the order of my elements on a mobile webpage?

Check out my awesome website:

maitxhomes.com/main.html

The layout looks amazing on desktop browsers, but it's a mess when viewed on my phone. The content in the blue section and footer just stacks in a long column that goes all the way down the screen. Could this be due to the <ul> in my HTML code or is it a CSS issue? Is there a specific @media query I should add to fix this problem?

Answer №1

If you want your website layout to be responsive on various devices such as mobile phones, tablets, and desktops, you need to link the bootstrap file to your website accordingly. For example, if you want your website to be optimized for desktops, use the ".col-md" or "col-lg" class.

However, if you want your website to display correctly on small devices like mobile phones, you should add the 'col-xs' class.

For example:

<div class="container">
<div class="row">
<div class="col-xs-3 col-sm-4">content 1</div>
<div calss="col-xs-9 col-sm-8">Main content</div>
</div>
</div>

This approach should help address any issues you may be experiencing.

For more information, check out the following link:

Bootstrap Grid Options

Answer №2

Eliminate the style in .container that defines the width. Also, delete the rule in tri-section that specifies a height.

Delete from line 3:

.container {
  width: 960px
}

And on line 189:

.tri-section {
  height: 130px;
}

When you set explicit values for height and width, you are essentially making those elements non-responsive.

In addition to resolving your specific issues, it is important to develop websites with a mobile first approach if you anticipate users accessing your site from screens other than desktop-sized ones.

You may encounter more challenges by adopting a desktop-first strategy.

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

Ways to incorporate a border line between a pair of icons within a bootstrap card

Incorporating a border line within the card-header is my current goal. My approach involves positioning two icons - one on the left side and the other on the right. Illustrative example below: https://i.sstatic.net/BgxVu.png Utilizing HMTL and CSS to ac ...

Retrieve data in JSON format from an external source file

I've been attempting to retrieve JSON content from an external file named list.json, but unfortunately all of my efforts have been unsuccessful. I've created a prototype of my code on Jsfiddle (http://jsfiddle.net/ctmvcyy1/). I believe that the ...

How does adding padding cause two horizontal divs to become vertical?

I noticed that when I remove the padding from the code below, two vertical divs become horizontal. This is confusing to me because I thought padding only affects internal spacing. I was expecting the two divs to be aligned horizontally. <style> #w ...

Prevent parent element from triggering double click when double clicking on children element with CSS or jQuery

Check out my project demo here Whenever I double click on a child element, it also triggers the parent element at the same time. I want to prevent this behavior so that only the child element is affected by the double click event. Can anyone provide assis ...

Enhance your browsing experience with Fire-fox add-on that automatically triggers JavaScript after YouTube comments have

I am currently working on creating an add-on for the Firefox browser. I have implemented a page-mod that triggers a script when specific pages (such as Youtube) are loaded, allowing it to communicate data back to the main script. However, I am encountering ...

The renderToString function in Material UI's sx property doesn't seem to have

Every time I apply sx to a component that is rendered as a string and then displayed using dangerouslySetInnerHtml, the styles within the sx prop do not work. Here is an example showcasing the issue: Codesandbox: https://codesandbox.io/p/sandbox/wonderfu ...

Could you assist me in navigating the process of creating a dynamic 10x10 multiplication table using HTML and JavaScript? I'm eager to learn where to begin with this methodology

As I explore various questions related to the "simple" multiplication tables, I find myself with a more fundamental query. I am seeking clarity on how Javascript operates when intertwined with HTML, as that is where my confusion lies. In my multiplication ...

"JavaScript code for creating a dynamic switching effect in HTML

I currently have 4 divs on my webpage that can be hidden or shown using JavaScript when clicking the menu at the top of the page. Here is my current script: <script type="text/javascript"> function showHide(d) { var onediv = document.get ...

What is the best way to showcase the output of a Perl script on a webpage

I recently came across a resource discussing the process of executing a perl script from a webpage. What is the best way to run a perl script from a webpage? However, I am facing a situation where the script I have takes more than 30 seconds to run and d ...

Enhance Your List with Icon Decorations

Is it feasible to utilize a sprite image in place of the default bullet for an ul list? Is this achievable? ...

Tips for adjusting the admin panel's content area to fill the entire width

I am currently working on HTML code for an admin panel. Here is a basic structure: body {margin: 0} .adminpanel { display: flex; height: 100vh; } .leftpane { width: 250px; background-color: #0038a8; } .rightpane { width: 87%; backgrou ...

Connecting Angular TextArea functionality to the Ctrl-Enter keyboard shortcut

Recently, I've been working on creating a custom functionality for the <textarea> element. My goal is to have the enter key trigger a specific function, while using ctrl+enter will add a new line in the textarea. I've tried looking through ...

Ways to Achieve the Following with JavaScript, Cascading Style Sheets, and Hypertext

Can someone help me convert this image into HTML/CSS code? I'm completely lost on how to do this and don't even know where to start searching for answers. Any assistance would be greatly appreciated. Thank you in advance. ...

The responsive push menus refuse to open automatically and fail to function

Before we go any further, take a moment to explore the demo here: http://tympanus.net/codrops/2013/04/17/slide-and-push-menus/ I decided to work with the source code from the demo by creating new files for Javascript, CSS, and HTML. To simplify things, I ...

Bootstrap 4.6 - new feature: flexible vertical pills and sleek horizontal tabs (inactive tab no longer highlighted)

I recently implemented Bootstrap 4.6 into my project. The page I am working on includes both vertical pills and horizontal tabs. While the vertical pills are displaying correctly, I have encountered an issue with the styling of the horizontal tabs when th ...

Switch between showing and hiding a div by clicking on the panel header and changing the symbol from + to

I need assistance with a panel feature on my website. The panel should expand when the "+" symbol is clicked, displaying the panel body, and the "+" symbol should change to "-" indicating it can be collapsed by clicking it again. There is a slight twist t ...

Internal Anchors malfunctioning on a stationary parallel site

Struggling to implement a scroll-down feature upon click <a href="#scrollto" id="scroll"> <div class="arrow-down"><img class="arrow-open" src="assets/img/arrow-sm.png"></div><a/> directing to: <p id="scrollto">MadHous ...

Adjust the content of an iframe based on the size of the screen

Hi there, I'm currently facing an issue with an ad that can't be resized. The support team suggested using two different ads - one for mobile and one for desktop. The dimensions of the ads are 720 x 90 and 300 x 100. I would like the ad to automa ...

Shifting the position of an HTML page to one direction

I'm currently working on adding a sidebar to my Twitter Bootstrap 3 project. The goal is to have a fixed positioned nav nav-pills nav-stacked show up on the left side of the page when a button is clicked. I've set its z-index to 1000 so it appear ...

The collapsible navbar vanished, where did it go?

While experimenting with the carousel template page, I noticed that the NavBar collapses when the screen width is reduced below a certain pixel size. Initially, everything was working fine as intended. However, after making some modifications to the carou ...