Customize the User Agent Stylesheet to improve text readability and accessibility

I am trying to make a simple, standalone page with menus that populate the text box (the one with "Left 1"). The text in the box is way to small on mobile and on desktop computers.

https://i.sstatic.net/PX3tB.png

I am trying to make this text box legible but can't find a way to. I tried adding code to override the User agent but it didn't work - ideally I would want to do this inline.

https://i.sstatic.net/fjanv.png

Here's an anonymized codepen because I don't want to share the whole project publicly

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" href="css-ta-mere.css" />
        <title>martians on earts?</title>


<script src="html2canvas-example-master/html2canvas.min.js"></script>



<script type="text/javascript">



</script>

</head>

<body>

<div>



</div>
  
  <span style="color:#FFFFFF;"><h1 style="font-family:Metropolis-Thin,arial,helvetica,sans-serif,light;">
  


  
        
        

          <style>
    .button {
        background-color: #ff7676;
        border: none;
        color: white;
        padding: 8px 10px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 25px;
        margin: 4px 2px;
        cursor: pointer;
        border-radius: 8px;
    }
    .button:hover {
        background-color: #7d7d7d;
    }
    
    
            @font-face {
            font-family: Metropolis-Thin;
            src: url(fonts/Metropolis-Thin.otf);
        }

        html,
        body {
            /* height: 100%;
            width: 100%;
            overflow: auto; */
            /* pointer-events: none; */
            background-color: black;
            /* margin: 0; */
            font-family: Metropolis-Thin;
            /* overscroll-behavior: contain; */
        }
    
    a:link {
  color: deeppink; 
  background-color: transparent; 
  text-decoration: none;
}

a:visited {
  color: coral;
  background-color: transparent;
  text-decoration: none;
}

a:hover {
  color: wheat;
  background-color: transparent;
  text-decoration: underline;
}

a:active {
  color: darkturquoise;
  background-color: transparent;
  text-decoration: underline;
}

.override {
    style:font-size: 25px; !important;
}



</style>
            
  
  <table width="800" border="0" align="center">

<tr>
    <span style="color:#FFFFFF;"><span style="font-family:Metropolis-Thin,arial,helvetica,sans-serif,light;"><span style="font-size:72px;"><td colspan="2" align="center">bleep bloop<br />
<br />

</td></span></span></span></span>
</tr>


    <tr>

          

    <td align="center">LEFT
    <br/>
  
  
<input type="text" id="leftLabel" value="Left 1" style="font-family:Metropolis-Thin,arial,helvetica,sans-serif,light;" style="font-size:22px;">



<br/>

<select id="leftSelect" style="font-size:22px">
  <option value="l1" selected>Flow</option>


</select>


  </td>
  
    
    <td align="center">RIGHT
    <br/>




<input type="text" id="rightLabel" value="Right 1" style="font-family:Metropolis-Thin,arial,helvetica,sans-serif,light;" style="font-size:22px;" class="override";>

<br/>

<select id="rightSelect" style="font-size:22px">
  <option value="r1" selected>Flow</option>


  
</select>



<br/>

</td>

</tr>

<tr>

<td colspan="2" align="center">
<button id="pandabear" class="button" style="h1">BUTTON</button>
</td>
</tr>


</table>




</body>
</html>

Answer №1

The problem lies in having 2 style properties within the same tag, which results in the second style being overlooked. The current code reads:

<input type="text" id="leftLabel" value="Left 1" style="font-family:Metropolis-Thin,arial,helvetica,sans-serif,light;" style="font-size:22px;">
. The second style="" is not considered. To address this, you can merge them into one by using
<input type="text" id="leftLabel" value="Left 1" style="font-family:Metropolis-Thin,arial,helvetica,sans-serif,light; font-size:22px;">
. It is recommended to follow best practices by utilizing a separate <style> tag and containing all custom properties within it.

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

Adjust the height of the container div for the carousel according to the length of the text displayed

My image carousel features description content positioned on the right for wide-screen windows. However, I want the description to shift below the images when the browser window reaches a certain breakpoint. The challenge I am facing is that the height of ...

Resizing Images in a Responsive Design

When creating a website, have you considered options besides resizing images for mobile devices? Instead of downloading the full image and resizing it to fit the screen, causing strain on CPU and RAM, are there alternative methods that could be more effi ...

What is the best way to get both the id and name of a selected item in Angular?

Within my select field, data is dynamically populated based on names. My objective is to not only capture the selected name but also its corresponding ID. Here's a snippet of my HTML template: <select class="custom-select d-block w-100" id="test" ...

The Jquery Addclass function is not functioning properly

I have been struggling with this code as it seems to not be working in any browser, including IE, Chrome, and Firefox. I suspect that the system should add a class, so I checked the DOM using Chrome's console. I did see the class being added, but ther ...

What could be causing the span class data to not be retrieved by the getText method

Looking to retrieve the value of a span class called 'spacer-right big project-card-measure-secondary-info' <span class="spacer-right big project-card-measure-secondary-info">1</span> snippet of code: browser.waitForEl ...

What is the best way to add a specific class to another class in my CSS code?

Is it possible to apply a CSS class defined in css1.css to another HTML class defined in css2.css? In css1.css: div.classPredefined { border: solid 1px #000; } In css2.css: div.newClass { background: #CCC; /*apply-class: classPredefined;*/ } Although ...

Passing a PHP array to a JavaScript function using a button click event in an HTML form

It seems there was some confusion in my approach. I'm working with a datatable that has an edit button at the end. Clicking on this button opens a modal, and I want to pass the data from the table to the modal. While I can send it as a single variabl ...

How to Stop Fixed Elements in iOS from Zooming

I'm currently working on a responsive website with a fixed header and navigation. Is there a way to allow users to zoom in on the page's content without affecting the fixed elements? Thanks for any help! ...

The space residing above my primary container division

I recently finished creating a basic web app, but I'm encountering an issue with the smallest media query where there is an unwanted top gap. Despite trying multiple methods and researching solutions online, I have not been able to resolve this proble ...

Efficiently verifying elements within an array

I have a roster of students categorized based on their activity status - some are active, while others are inactive. var allActive = [{id: 1, active: true}, {id: 2, active: true}, , {id: 3, active: true}]; var someNot = [{id: 4, active: true}, {id: 5, act ...

What is the more effective choice for Automation Testing: Static or Dynamic dropdown menu options?

Currently facing an issue with dropdown selections while conducting automated testing. Selenium's Select(); method has been reliable when running tests in multiple cycles and choosing different options each time. The challenge arises when the dropdow ...

Tips for integrating Less and Bootstrap in an Angular 6 project

After making changes to angular.json to use less as the styleext, I tested it by creating a component. However, now I want to incorporate Bootstrap classes into my component's css/less. I specifically want all buttons in my component to have the .mx-1 ...

JavaScript code to make titles slide in as the user scrolls

Looking for a better way to make all titles slide in upon scrolling instead of coding individually? Consider using a forEach loop! Here's how you can modify the code below: function slideInLeft() { document.querySelectorAll('.subtitle-left ...

Utilizing Jquery's Selectable IDs in a repetitive manner

I'm a newbie to jQuery and I'm attempting to create two lists where each item can be selected. Check out my code: <!doctype html> <html lang = "en"> <head> <meta charset = "utf-8"> <title>jQuery UI s ...

Is your Z-Index failing to make an impact?

Currently, I am attempting to layer divs on top of a background image. All the elements have designated position attributes, and I have applied a 50% opacity to the background image so that what's behind it is partially visible. Despite setting the z- ...

Managing mouse click events in jQuery

Here on SO, I successfully implemented the mouse down handler. Now, my goal is to separate these functions into their own file named test.js. Within test.js, the code looks like this: function handleMouseDown(e) { console.log('handleMouseDown&ap ...

Image cannot be inserted into the div container

I've created a wrapper div with a text div and an image div floating to the right. It should have been a simple task, but for some reason I can't seem to get it to work tonight. I'm completely stuck. Take a look at how it appears currently: ...

Detecting the specific button that was selected with PHP

I am in the process of developing a website for a production company where, upon clicking on a director's name from the menu, all other menu items disappear and only the selected director's biography and work are displayed. My current challenge ...

Trouble filling a List<WebElement> from a Table using Selenium Java

I am experiencing difficulty filling a List from a table: <div class="es"> <button class="btn btn-primary" [routerLink]="['add']">New User</button> </div> <div class="User_table" id="t02" > <div class="table ...

Implementing dynamic content loading using CSS and jQuery upon link/button activation

I'm facing an issue where I am attempting to align content to the left side of my screen to display a feed while also ensuring that the pushed content is responsive. Unfortunately, the feed is not visible and the content remains unresponsive. Is ther ...