The issue of CSS not functioning properly across various page sizes

I have created my toolbar:

    <header className='toolbar'>
        <nav className='toolbar_navigation'>
            ///hamburger:
            <SideDrawer drawerClicked = {props.drawerClicked} />
            ///LOGO
            <div className='toolbar_logo'>MYCOOKIES</div>
        </nav>
    </header>

This is the styling I applied:

.toolbar {
    position: fixed;
    width:100%;
    top:0;
    left:0;
    height: 60px;
    border-bottom: 1px solid #E4E7ED;
    background-color: white;
}

.toolbar_navigation {
    display: flex;
    height: 100%;
    padding-left: 18px;
    justify-content: space-between;
    align-items: center;
}
.toolbar_logo{
    color:#bfa290;
    text-decoration: none;
    font-family: 'Segoe UI';
    font-weight: 510;
    margin-right: 115px;
    cursor: pointer;
    font-size: 25px;
}

However, when I view it on mobile phones such as iphone 6 and iphone 5, the layout appears differently. Here are some examples: iPhone 6: http://prntscr.com/sujtsb iPhone 5: http://prntscr.com/suju09 Can anyone advise me on why this is happening and how to fix it? Any help would be greatly appreciated!

Answer №1

When designing for mobile devices, considering aspect ratios is crucial. To ensure consistency across various mobile screens, remember that the iPhone 5 is approximately 45px narrower than the iPhone 6; therefore, it's advisable to utilize units like vw rather than px for margins. For further guidance, delve into css units and media queries.

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

How to select a DOM element in Angular 2.x

Although it may seem simple, there are not many examples of using Angular 2.0 yet. In one of my components, I have a situation where I need to add a class to the body tag. However, my application is bootstrapped deeper than the body element, so I am looki ...

Retrieve the route.js directory using Node.js

My server.js file is located in the directory: /dir1. To start the server, I use the command node server.js. In the directory /dir1/app/, I have my file named routes.js. I am trying to find out the directory path of the server.js file. However, I am unc ...

Working with React Hooks: Implementing a POST request to a server

I am new to React.js and I need help with sending a POST request from a form to a database. I believe I may need to include <form action="URL"> in my implementation. Any assistance would be greatly appreciated. Below is the code snippet fro ...

Error message encountered: Missing property status in TypeScript code

An error occurs in the refetchInterval when accessing data.status, with a message saying "property status does not exist" chatwrapper.tsx const ChatWrapper = ({ fileId }: ChatWrapperProps) => { const { data, isLoading } = trpc.getFileUploadStatus.use ...

What is causing the unexpected impact of the "Product Quick View" JavaScript plugin on divs that are not being activated by user interaction?

As a newcomer to web design, I have implemented the "Product-Quick-View" plugin from CodyHouse on my website. Upon clicking the DEMO button and inspecting the code, you will find the following: <body> <header> <h1>Product Q ...

The art of defining PropTypes for the style attribute in Reactjs

Is there a way to pass the 'style' attribute into my component using JSX syntax? <InputTextWithValidation id="name" style={{width:'100%'}} .../> I'm wondering how I should define the PropTypes for ...

Node.js allows for keeping pipe and sockets open even after streaming an HTTP response

My current challenge involves streaming data from an HTTP response to a cloud storage provider within an internal service. const response = await request<Readable>({ headers: httpOpts?.headers, data: httpOpts?.data, url, method, responseTyp ...

Target the most recently loaded Vue.js element using jQuery's focus method

Hey there, I am currently utilizing Vue.js to load some data and below is the code snippet: add_line:function() { index = this.lines.length; this.lines.push({id:index}); $('.search_and_select').last().focus(); ...

Turn off the feature of map scrolling on OpenStreetMaps

Is there a way to prevent mouse interactions and scrolling in an open maps iframe? I have already tried adding the attribute scrollwheel="false" to no avail. Are there any CSS methods to achieve this? <iframe id= "mapsource" scrollwheel="false" src="ht ...

JQuery is unable to validate a form that is being loaded from an external HTML file

I'm encountering an issue where my form imported into a separate HTML file is not validating using JQuery's $(form).validate() plugin. After following the guidance provided in this question, I successfully managed to get the form working. Howeve ...

Address the Firebase error using the router action handler

I am facing an issue with handling Firebase Authentication Errors because the function is at the top level, preventing me from using Usestate. I need to find a way to display the error in the JSX. I have tried various methods such as using arrays push and ...

I'm having trouble getting this text to align properly next to the image. Plus, I can't seem to achieve a horizontal screen alignment either

There seems to be an answer available, but I'm clearly not understanding it, so I've come here seeking further explanation and assistance. CSS can be quite complex, right? Here's a screenshot of my current project: https://i.stack.imgur.com/ ...

Designing divs of the same dimensions with a wrap-around effect

I'm currently working on developing a menu system that incorporates images and text above and below each image. The content is dynamic, so I need the menu layout to display with equal spacing between each image, creating a grid-like pattern both horiz ...

Unable to retrieve the value from a textarea when using Shopify Product Options by Bold

I'm currently facing an issue trying to retrieve the value of a textarea using Shopify's Product Options by Bold. The code works fine locally, but when I transfer it over to Shopify, I am unable to get the value. Despite looking at various resour ...

I'm curious, what is the name of these line-boxes in Chart.js and is there a way to disable them?

When using Chart.js doughnut charts with react-chartjs-2 in a React application, I noticed that there are these line-box elements displayed for each section of the chart. Here's an example: https://i.stack.imgur.com/JRPpk.png I'm curious about ...

Using a jQuery function with onclick events in a loop

I'm faced with a challenge in jQuery/js programming and could use some guidance as I am relatively new to this. function initiateViewingProcess(){ var elen =$MP.data.REG_AS_RS.ASSIGNEE.length; for (i = 0 ; i < elen ; i++) {var dEv ...

Retrieving pictures by their unique identification number

Utilizing a flexslider, I have set up an image display feature as shown in the JSFiddle link below. The slider has been optimized to dynamically extract images from a specific directory, where images are named with numbers like 1023, 2045, 304654, and so o ...

Interactive bar chart that updates in real-time using a combination of javascript, html, and

Current Situation: I am currently in the process of iterating through a machine learning model and dynamically updating my "divs" as text labels. My goal is to transform these values into individual bars that visually represent the values instead of just d ...

Switch the CSS class for the currently selected link

There are 5 links on the page. When I click on each link, it changes color. However, when I move my cursor to another area of the page, the active link loses focus and I can't show its current state. Can you please advise me on how to fix this issue? ...

Retrieve all items from the firebase database

I have a query. Can we fetch all items from a particular node using a Firebase cloud function with an HTTP Trigger? Essentially, calling this function would retrieve all objects, similar to a "GET All" operation. My next question is: I am aware of the onW ...