Styling Buttons for both Desktop and Mobile Using CSS

The CSS buttons I designed looked amazing on desktop, but when viewed on mobile devices, they appear unappealing and fail to utilize the specified styles. How can I ensure consistent button styling across all devices using CSS?

Below is the code for the buttons that displayed perfectly in the browser:

input[type="button"]
{
width: 416px;
border: none;
color: #fff;
font-size: 1em;
padding: .5em;
margin: 5px 0 5px 0;
border-radius: 3px;
font-weight: bold;
line-height: 40px;
background: #00aeff;
}

input[type="button"]:hover
{
background: #00a0db;
}

However, this is how they appeared on various mobile pages.

Answer №1

There is no one-size-fits-all solution. It's important to ensure your styles include the necessary platform-specific directives (such as -webkit-) and are compatible with the platforms that may be causing issues.

Answer №2

The problem regarding the font size can be resolved by specifying a pixel value for the font. When you set it in pixels, everything should display correctly.

For example:

input[type="button"]
{
  font-size:14px;
}

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

Achieve horizontal wrapping of div elements

Currently, I am developing a blog where search results for articles will be displayed within divs. The design of the website is completely horizontal, meaning that articles scroll horizontally. Creating a single line of divs is straightforward, but it&apo ...

What is the best way to incorporate a new property into an already existing CSS file

I currently have two CSS files. Below is a sample of a class from one of the CSS files: input[type="submit"], input[type="button"], .butLink { padding: 3px 9px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -khtml-border-radius: 3px ...

Attempting to eliminate the padding from the unordered list (ul) element within the pop-up box

Upon clicking the chip with chipName="button test IPA", a popup window appears. I am attempting to remove the padding from the ul tag within that popup. The issue I'm facing is that I cannot locate the ul tag in my HTML or JSX code. I have assigned a ...

Adding new divisions to an already existing division with angled borders

I am currently attempting to create a header similar to the one displayed in the attached image. Despite trying various solutions found on this platform, I have not been able to achieve the desired result. I have managed to work out the text and logo eleme ...

Steps to modify the border style upon clicking expand or collapse functionality

I'm working on a button that should expand when clicked, remove the bottom border, and then restore the bottom border upon collapsing. I've created a function to handle this behavior, where each click increments a counter. The goal is to show the ...

Trouble with Bootstrap accordion data-toggle function on mobile devices

I noticed that someone else had asked a similar question without receiving an answer. I am currently having issues with Bootstrap's data-toggle for an accordion, particularly on mobile devices (not just IOS but also on Chrome developer tools and my Ga ...

Those skilled in the art of Drag and drop

Currently, I'm delving into the world of drag and drop functionality. While it's not overly difficult to grasp, there is one aspect that is really bothering me. As I navigate through this process, I stumbled upon this informative resource: http:/ ...

The background color property of the CSS class "ui-layout-north

Currently working with primefaces 4.3 and incorporating it into my main UI. My goal is to modify the background color of the north unit to red, as currently only the top 80% of the unit is affected. .ui-layout-north .ui-layout-unit-content { backgro ...

The background image is not appearing on the div as expected

I've been attempting to create a div and set a background image for it using jQuery, but I seem to be facing issues. When I try setting the background color to white, it works fine. Here's the code snippet: function appendToDom(poster) { ...

Tips for swapping out an SVG icon with a font-based icon like Font Awesome or Ion

I have a dropdown menu that displays an SVG icon, while all the other menus show a button with a font-based icon (ion-icon). I want all the dropdown menus to have a consistent look. I've attempted to adjust the CSS code and searched through various . ...

The ">" CSS child selector does not seem to be functioning correctly with specific properties

While experimenting with applying CSS properties to direct child elements of a parent element using ">", I noticed that it works smoothly with certain properties like borders, but not so much with font-related properties such as color and font-weight. ...

Tips for customizing the style of a TextBox

In my website, I utilize bootstrap along with custom CSS styles as shown below: .ff { // id of the form font: 15px/1.6em Lato, serif; max-width: 280px; margin: 0 auto; margin-top: 20px; color: #767a7f; } .ff div { position: rel ...

Improving the loading speed of HTML tables when querying large amounts of data | Enhancing performance with PHP, HTML, and SQL Server 2012

I'm encountering an issue with loading data from my database. The dataset is quite large, causing a noticeable delay. Even after adding the following code snippet, the problem persists: .fixed-table { table-layout: fixed; } While researching a ...

Arrange 4 divs (children) at each corner of the parent element

Currently, I am facing a challenge in positioning 4 divs in the corners of their parent div. The HTML code structure is as follows: <div class="resize"> <div class="n w res"></div> <div class="n e res"></div> < ...

Does Google's caching process differ when using <span> tags instead of <h> tags for headings?

Does the choice between using <span class="heading"> and <h> tags impact search engine optimization for Google? As I'm constructing a website, I decided to style the headings and subheadings with <span>. However, I began to wonder i ...

The navigation bar spans the entire width of my webpage

I came across this cool man code at and I'm trying to make the menu bar stretch across the entire width of my page. The theme I'm using is called nvidia. You can download the original code by getting the zip file from the link above. Here&apos ...

Ways to Personalize Button URL based on Image?

In my View Controller, there is an image and a button that takes the user to a specific URL. I've also added two additional images and a Swipe Gesture for transitioning between them. These images represent different profiles, and I want the button&apo ...

Apply a border around every digit within a division

Is there a way to add a border to each individual number within a div? I already know how to add a border to a div as a whole, but I specifically want each number inside the div to be bordered. For example: <div id="borders">12345</div> The ...

Having trouble viewing the CSS menu on Internet Explorer 8? Could it be a potential JavaScript issue causing the problem?

Receiving complaints about the menu bar dysfunction in Internet Explorer 8 has left me bewildered. Despite working perfectly on all other browsers and earlier versions of IE, I cannot figure out what's wrong with the code. You can view the website at ...

Scrollbar not appearing when overflow-y is set in React Textarea Input on Chrome or Edge

I've been struggling to add a scrollbar to a React Textarea. I've referred to an old post on Stack Overflow here and a few other resources, but haven't had any luck. I've tested it in both Chrome (Version 113.0.5672.129) and Edge (Vers ...