Tips for managing responsive font sizes as screen size decreases

Hey there, I could really use some assistance with a new website I've been working on. While I have experience building Joomla sites for the past 6 months, this is my first attempt at making a responsive site using media queries.

You can check out the site I've put together here:

[

I've created media queries for various screen sizes such as 768px, 600px, 568px, 480px, 400px, and 320px. However, I'm encountering some issues with certain sizes, particularly when viewing the site on my Samsung S6 where the screen maxes out at 640px. This was causing problems with an image 'box' I had used, which was in PNG format.

To address this issue, I converted the image to an SVG file so it could resize accordingly based on the screen size. Here's a snippet of my CSS:

@media (max-width: 767px) and (min-width: 601px) {

#mainbox {
  float: left;
  position: relative;
  background: url(../images/box.svg) no-repeat;
  background-size:contain;
  margin-bottom: 40px;
}

In addition, I ensured that the text within the boxes has a width of 100% to resize along with the box itself.

The current challenge I'm facing is figuring out how to make sure the heading on the page, "WE FIX BROKEN, DAMAGED MOBILE PHONES," resizes similarly to the box and its text.

As I resize the screen from 767px to 601px, I notice a gap appearing under the mobile phone image, and I'm struggling to resolve this issue. I've tried using em units for font sizes, thinking it would work like SVG, but unfortunately, it doesn't seem to be the case.

My site was built using the latest version of Joomla 3.8.4, and just to note, the template already includes the Bootstrap framework. Here's the code in my index.php file:

JHtml::_('bootstrap.framework');

Your guidance on what I might be doing wrong and what considerations I need to keep in mind to ensure correct display while resizing the page without adding more breakpoints would be greatly appreciated.

Answer №1

After reviewing your inquiry, I believe the most efficient method for creating a responsive website is by utilizing Bootstrap. Bootstrap offers pre-defined classes that can be used to ensure responsiveness.

<img src="source" class="img-responsive" width=100% height=500px/>

Furthermore, Bootstrap includes a grid system for easy alignment of elements.

I trust this information proves beneficial to you.

Answer №2

Upon reviewing your media query styling for the text within the .boxestext1 div, I have noticed an issue where the text exceeds the width of the container at narrow viewports, causing overflow.

A potential solution could involve modifying the CSS code as shown below:

@media (max-width: 480px){
    div.boxestext1 {
        ...
        margin: 0;
        width: 100%;
        ...
    }
} 

By implementing this adjustment, the text should scale more effectively on smaller screens. It's important to avoid hardcoded widths and units for optimal mobile performance.

Best of luck with your design!

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

Customizing data from AJAX responses

Using PHP, I am receiving data as an object and passing it through a mustache template to create a table. My inquiry is about controlling the row breaks for my data. Is there a way to insert a <tr> after every 3 <td> without using JavaScript? Da ...

Generating a dataframe with cells that have a combination of regular and italicized text using the sjPlot package functions

I've been trying to set up a basic data table where the genus name in the "Coral_taxon" column is italicized, but the "spp." part following it remains lowercase. I thought of using the expression() function for each row in "Coral_taxon," but so far, I ...

Searching for various values in PHP with user input

I am currently working on implementing a basic search tool that allows users to search the database by providing certain inputs. The form consists of 3 input fields: However, when I attempt to search one by one, only the first field functions correctly w ...

What is the best way to auto-fill input fields with data from a Json file

My goal is to automatically populate HTML form fields based on user selection. I have obtained code for related functions, such as fetching JSON data and creating dropdown lists, from a friend. Here is the link to that code: https://jsfiddle.net/r4zuy7tn/1 ...

I am in need of a blank selection option using an md-select element, and I specifically do not want it to be

I'm currently utilizing Angular Material with md-select and I am in need of creating a blank option that, when selected, results in no value being displayed in the select dropdown. If this blank option is set as required, I would like it to return fal ...

Utilizing a Web Interface for Remote Monitoring of Windows Servers

I am in need of creating a webpage that will indicate whether a server is currently operational or not. These servers are all Windows based, with some running on 2008 and others on 2003. They are spread across different networks within various client locat ...

jQuery will envelop the HTML elements in an inconsequential div

Imagine a website that is visually complex, with various styles and images positioned in different ways. What if we wanted to add a small overlay icon above each image? At first, the solution might seem simple - just use absolute positioning for a span el ...

Use Vue.js to shorten the number of decimal places and include commas in numerical values

How can I best parse a long number retrieved from a JSON using VueJS within a for loop? The JSON data is used in a v-for prop to create Li elements for a side navigation. I attempted to use vue-numeric without success since the project does not utilize ECM ...

Place a hyperlink button within a designated cell of a data table

I am relatively new to using mysqli and while I believe I have grasped the basics, I am struggling with adding a button to a table that I can trigger. Here is the code snippet I am working with: while($row = mysqli_fetch_array($result)) { echo "<tr al ...

PHP encountered an issue while trying to compare the value stored in the $_POST variable with the value stored in a

In my current project, I have utilized a JSON file to store data and PHP to retrieve and display it. However, I am facing an issue when comparing values from $_POST - specifically, if the value contains spaces, the comparison fails. Here is the problematic ...

Handling the display of divs using two select elements

I've been pondering this problem for a while now, and I'm starting to believe that there may not be a solution. Essentially, what I am trying to achieve is the ability to select options from two dropdown menus which will then show or hide specifi ...

Breaking the layout using recursive components in VueJS

I am currently facing an issue where I need to dynamically load components. However, when some of these components are loaded, they appear with faulty or missing CSS styles due to a problematic first div element after the template. Removing this DIV manual ...

Unable to access the following element using jQuery's next() method

Can someone help me understand how the "next" function works in jQuery? I'm trying to reveal a hidden textarea when a span element is clicked. The hidden textarea is supposed to be the immediate next sibling of the span, but it's not working as e ...

Tips for updating the content of a div with fresh data using a slideshow effect in jQuery

Imagine you have a div called A and an array filled with text data. When t=0, div A will display $data[0]. Then, after every n seconds, I want the div to show the next piece of data in the array. I am interested in creating a transition effect similar to ...

As soon as I hit the submit button on my website form, the URL is automatically refreshed with the information I provided

I am a beginner when it comes to forms and recently copied and pasted this login snippet code: <div class="login-form-1"> <form id="login-form" class="text-left"> <div class="main-login-form"> <div class="login-group"> ...

Utilizing HTML's multiple input type color feature to save selected colors directly to the database

I am currently using the input type color to select colors for customizing my site. I save the selected color to a database and then retrieve it to apply it to different areas of the site. This works well for a single input type color, but now I have mul ...

FadeOut Television static on Canvas after a period of inactivity

Is there a way to smoothly fade out the TV noise after a specific timeout period? I found this code snippet on Stack Overflow that seems to address a similar issue: var canvas = document.getElementById('canvas'), ctx = canvas.getContext( ...

I am experiencing an issue where my mobile responsive website consistently shows the smallest CSS width view. What could be the root of this

Currently, I am developing a mobile-responsive website specifically catered to iPhone 6 Plus and smaller models (iPhone 6 & 5 included). When I preview the site using "Inspect Element" in the Chrome browser with these device settings, everything appears t ...

Nested foreach loops interacting with one another

I am attempting to execute multiple nested foreach loops and stop at 12 iterations, however the current code I have is not functioning as expected. While it displays the desired output, there seems to be an issue where only the first image in each director ...

What is the best way to design a table where the cells can flow or wrap instead of being confined to a strict grid?

Struggling with designing a layout for my website as I lack experience in web design. Unfortunately, the only software I have access to is FrontPage which is not meeting my requirements. I aim to create a webpage with multiple "cells," each featuring an i ...