When my website is viewed on a local server, it is responsive and utilizes flex and bootstrap. However, now that it is hosted online, the flex function is not working properly on the mobile site

As a novice web developer, I've created a portfolio site hosted at www.j-price.co.uk. However, I've encountered a responsiveness issue after hosting it on GitHub Pages and GoDaddy. The site displays differently compared to when it's hosted locally through VSCode. The items don't stack as expected and a vertical scroll bar appears. While Chrome Dev Tools show no issues, testing the site on my phone reveals the problem.

I've experimented with changing the <meta viewport width> as suggested on Stack Overflow and added cross-browser compatibility. Despite these efforts, the issue persists. I'm uncertain if there's something missing in my code or if it's related to the hosting setup.

Below is a snippet of my HTML:

<!DOCTYPE html>
<html lang="en">
  <!-- Head section with meta-tags, title, SEO attributes, Bootstrap and Font Awesome links -->
  <head>
    ...
  </head>

  <!-- Body section with header, projects, about me, and contact sections -->
  <body id="body">
    ...
  </body>
</html>

And here's a CSS snippet for styling the site:


    /* CSS styles for general layout, navbar, hero section, projects, about section, and contact section */
    ...

Lastly, here's a snippet of JavaScript code used for dynamic content:


    // JavaScript function to display rotating adjectives
    ...

Answer №1

I have encountered many of the challenges you are currently facing. By crafting your own CSS without relying on frameworks like Semantic or Materialize, you can avoid these issues. While it may require more effort initially, you will ultimately have complete control over your styling. I personally only use Font Awesome icons with a link, which simplifies things. Although it may feel overwhelming at first, spending time mastering CSS is more valuable than constantly troubleshooting. I have been developing a personal library of essential elements like navbars, cards, sidebars, and footers. Once these components are styled and bundled with CSS, working with them becomes much smoother. Additionally, I recommend exploring ReactJS for its speed, responsiveness, and efficient reusable component system.

Answer №2

Implement the meta tag

Understanding the viewport is essential for designing a responsive web page. It adjusts based on the device being used, with smaller dimensions on mobile phones compared to computer screens.

Every web page should contain the following code snippet: This provides necessary instructions to the browser regarding the page's dimensions and scaling.

<meta name="viewport" content="width=device-width, initial-scale=1">

Answer №3

After thorough investigation, I have identified the primary problem to be GoDaddy mounting my site in an iframe when utilizing masking for forwarding. However, when I opt for direct forwarding from my custom URL to my GitHub Pages hosted site without masking, all the code remains intact and the functionality is seamless. Although it may not be the most ideal solution in terms of maintaining a professional appearance for my custom URL, the positive aspect is that the site now loads correctly.

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

When the React component's state is updated, an animation is triggered in a subcomponent connected to the parent component

The ProjectsSection component is responsible for rendering a document section with a header and cards. The goal is to trigger a header animation only when the header becomes visible on the screen for the first time and have it run once. However, adding a s ...

The webpage appears to be operating smoothly when tested locally and on JSFiddle, however it is encountering

Just joined and brand new to this game. Completed a course at work over the last few weeks, and I must say, I'm really enjoying it. However, when I tried to create a page using Bootstrap styling and added an accordion and a carousel, both features fai ...

Combining D3.js tooltip positioning with CSS overflow styling

I am encountering an issue with displaying tooltips in D3 when combined with CSS overflow. Is there a solution available for this particular problem? CSS code: #chart1 { overflow-x: auto; overflow-y: hidden; max-width: 800px; max-height: 22 ...

Access the content of each cell in a table using JavaScript

I need help with a scenario involving a table that has 4 rows, where the 4th row contains a textbox. When the "onchange" event of the textbox is activated, I want to retrieve the data from the cells in that specific row and transfer it to another table. It ...

The property 'filter' is not recognized on the 'Object' type. An attempt to filter the response was made

Trying to fetch data from a JSON file that matches the player's name in the URL, such as localhost:4200/players/Febiven, should only retrieve information about Febiven. The code is written in Angular 6. The current code snippet is as follows: player ...

Click on the image to resize the div accordingly

I have a scenario where I need to achieve the following functionality: Two divs are present, with an image inside the first div. When the image is clicked, the left div should resize, and the content on the right side should expand to show full page cont ...

How to incorporate Django syntax into CSS styling

Imagine a scenario where a Django site is equipped with numerous stylesheets. CSS and JS files are located in the static/ directory within an app's folder or in the global site directory. Various color themes are employed across different pages, neces ...

Adjusting Font Size of Menu BarORModifying

I'm currently using WordPress to build my website. If you'd like to take a look, here is the link: I'm trying to make the font size smaller to accommodate more menu bars on the site. Any suggestions on how I can achieve this would be great ...

Is it possible to align two buttons side by side on a webpage using only HTML and CSS?

Can you help me figure out how to align two buttons next to each other with some space between them using only css and html? If you take a look at my html code and css code, you'll see that the two buttons are not aligned properly. * { margin: 0 ...

Display the CSS dropdown menu as a block`

I've been attempting to design a dropdown menu. My goal is for the anchor tag to display when hovered over. I understand that using display:block won't work when the 'a' is not part of the block, but I'm unsure how to proceed. Any ...

Is there a reason we are able to simultaneously assign the disabled and selected attributes to <option> elements?

What is the rationale behind permitting the simultaneous setting of disabled and selected attributes on <option> elements, knowing that their values will not be submitted to a server? I was surprised that I did not receive an error in VS Code when I ...

What is causing the horizontal misalignment of these divs? Why are they breaking onto separate lines?

This HTML code snippet contains a div element with nested divs styled with different border properties. The red divs are not displaying in the same horizontal row. What could be causing this issue and how can it be resolved to ensure that all red divs are ...

When using nextjs, there is an issue that arises when attempting to define the property 'id' using context.params.id. This results in

Attempting to retrieve data from a JSON file (response.json) hosted on localhost:8000/response.json. Below is the code snippet from pages/test.js: import React from "react"; import Link from "next/link"; import Image from "next/ima ...

Creating a dynamic form field using JavaScript

I'm struggling with a JavaScript issue that requires some assistance. I have a form sending an exact number of inputs to be filled to a PHP file, and now I want to create a preview using jQuery or JavaScript. The challenge lies in dynamically capturin ...

Crafting a Cubic Masterpiece with Pure CSS Gradient Magic

Experimenting with various techniques involving linear gradients, I have achieved layers of multiple stripes but have encountered a block when it comes to the top face. My goal is to use gradients, whether linear or radial, to create a series of repeatin ...

What's the best way to align several buttons in the center of the screen horizontally?

I'm struggling to properly align divs with images inside another div. My goal is to insert buttons into my HTML and use jQuery to center them automatically, but I can't seem to get it right. You can view the fiddle I've created here: http:/ ...

What is the best way to ensure input text fills the entire grid?

Take a look at this code snippet: <div class="form-group col-md-6"> <label class="col-md-4">Last Updated (Real Time)</label> <input class="form-control col-md-8" type="text" ng-model="status.lastUpdated" ng-readonly="true"/ ...

What could be causing my function to execute thrice?

I cannot seem to figure out why my tag cloud is causing the required function to run multiple times instead of just once when I click on a tag. This issue persists whether using jQuery or plain JavaScript. What am I missing? The code I have is very simple, ...

Storing parent entity along with child entities containing selected properties using ASP.NET Core MVC

Working on an ASP.NET Core MVC web app, I encountered a problem that can be best explained through this example: Let's consider a scenario where the user needs to save information about a book including its title, number of pages, and one or more aut ...

Having trouble retrieving the YouTube channel name using XPath node in Selenium and TestNG

My current task involves navigating to the YouTube website, entering the search term "qtp," and clicking on the Search button. Once on the results page, I need to extract the Channel Name. To achieve this, I used Firebug to identify the path for the first ...