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

Ensure the first column is fixed and all other columns have the same height

I have encountered an issue where the first column of my table has varying heights compared to the other columns, resulting in inconsistent row heights. Below is the code I am using: <div class="outer"> <div class="inner"> <table> ...

The <map> <area> element functions properly only in webkit browsers

Here is some HTML code: <div id="wrap"> <div id="main-content"> <div class="container"> <h1 class="logo">Mysite</h1> <img id="links" src="images/links.png" usemap="map" width="946" heigh ...

CSS dimensional changes

I am currently working on developing an application that involves incorporating a perspective map with the ability to add map markers represented by absolutely positioned DIVs. However, I seem to be encountering challenges related to transformations and 3D ...

Is there a way to integrate the javascript and jQuery functions in order to conceal a button?

I recently acquired the File Upload script known as Simple Photo Manager and I am looking to incorporate jQuery functions with the existing JS code in the script. My main goal is to make the Delete button disappear once it has been clicked. However, I am ...

Tips for triggering window load event on a particular page

I need to trigger the windows.load event on a specific page. Currently, I have set it up like this: $(window).load(function(){ if(document.URL == "/car-driving.html") { overlay.show(); overlay.appendTo(document.body); $('.popup' ...

Saving a Session Variable when a button is clicked in HTML and PHP

I'm struggling with storing Session variables when a button is clicked. I want to achieve this without using a form. Below is the code I currently have for my HTML and PHP. <?php session_start(); if(isset($_GET['oldsignin'])) { $user ...

Is there a Container with a Heading in Material UI?

Does anyone know how to create a container with a top title like the one shown in this screenshot: I've attempted using Box or Paper components, but I can't seem to find the option for a top title. Any suggestions? Thanks in advance for any ass ...

Safari has a unique feature where margins are not factored into the scroll width calculation

I am facing an issue with a container that scrolls horizontally. Inside this container, there are multiple items and I have added a margin to the last item on the right. However, in all browsers except for Safari, the margin is included in the scroll width ...

Utilizing the Power of ChartJs

I am currently in the process of developing a web application that will provide users with the ability to compare the number of calories they burn during exercise with the amount they consume in a meal. To achieve this goal, I have chosen to utilize ChartJ ...

Access a folder in JavaScript using Flask

I need to specify a directory in a script. $images_dir = '{{url_for('.../pictures')}}'; In my flask application directory structure, it looks like this: Root -wep.py -templates -gallery.html -static -pictures The images are stored ...

disabling empty elements in a React JS JavaScript component

Currently, I am retrieving data from an API where users can post content up to 3 times. However, if a user has not posted three times, empty boxes with padding and background color will appear. I want to remove all elements that do not have any content wit ...

The navigation bar extends beyond the container

First time diving into bootstrap and struggling with my items overflowing the container. Here's a snippet of my code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equi ...

Struggling to create horizontal buttons for my design

Does anyone have any suggestions for fixing my navigation bar? I attempted to create it myself, but I'm struggling to make everything function properly. https://i.stack.imgur.com/h4yA1.jpg Below are the images of the button in all three states: htt ...

HTML anchor tag failing to redirect to specified link

I need to populate the URI property from an API result into an HTML format. I attempted to achieve this by calling a function and running a loop 3 times in order to display 3 links with the URI property of each object. However, the code is not functioning ...

Scrolling does not function properly on Android devices when utilizing skrollr.js in conjunction with multiple div elements containing the id "skrollr-body."

Having trouble with the scroll functionality in my skrollr.js animations. Everything works fine on desktop, but when I checked the rendered HTML in the browser console, I noticed that there are two divs with the same id "skrollr-body". One is empty and the ...

Breaking the link from the image it is connected to using [middleman] css and html

My question is about an icon with a link attached to it. <%= link_to image_tag("infobutton_circle_blue.png") ,"http://redbullrecords.com/artist/awolnation/", :id => "about" %> After applying styles, the link may not work properly: <a id="abo ...

Discovering the exact distance between a 'li' and a 'div' element

Currently, I am in the process of converting HTML to JSON. Here is an example of the HTML I am working with: <div class="treeprofit" id="divTreeViewIncomeDetails" style="height: auto;"> <li><span class="fa fa-folder-open highlight" ...

Enhance form validation by utilizing jquery.validate to display appropriate icons indicating correct and incorrect input, with the option to

Trying to replicate the functionality of the jQuery validate plugin demo seen here, I am facing an issue on my own website. Upon clicking submit after the page loads, the plugin displays validation messages with a cross symbol. However, upon entering text, ...

Refrain from showing content beneath a certain element

Is there a way to hide all content that appears after a specific element, such as a particular class of div? The issue I am facing involves using a 1&1 webpage builder with a restrictive layout-template enforced by my boss. I am trying to remove the foote ...

Performance challenges with an AngularJS application that uses pagination

Resolving Performance Issues in Paginated AngularJS Posts Application I developed a compact application that showcases JSON data as cards using AngularJS and Twitter Bootstrap 4. The app includes pagination with approximately 100 posts per page. var ro ...