"Strategies for Handling Various Screen Resolutions in HTML

When developing a web page on a PC with a 1366 * 768 resolution, I encountered issues with layout distortion when viewed on a 1920*1080 resolution screen. How can CSS be managed to ensure consistent display across PCs with varying resolutions?

<html>
<head>
    <title>About US..</title>
    <script type="text/javascript" src="js/jquery-2.1.3.min.js"></script>
    <script type="text/javascript" src="js/about.js"></script>
    <link rel="shortcut icon" href="img/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="css/about.css">
</head>

<body>
<div class="main">
    <div class="header">
        <div class="header1">

        </div>

        <div class="left">

        </div>
        <a href="index.html"><div class="left1">

        </div></a>
        <div class="left2">
        In a Nut Shell..
        </div>
        <a href="about.html" id="left1a"><div class="left3">
            About Us
        </div></a>
        <a href="contact.html" id="left1b"><div class="left4">
            Contact Us
        </div></a>  
    </div>
    <div class="content">
        Meet developers Of "In a Nut Shell.."<br>

        ...

        </div>
</div>

...



<body{
    background: #BDBDBD;    
}

...

and CSS:

body{
    background: #BDBDBD;    
}

...

.sumeghadetail #banner a{
    font-family:Lucida Handwriting;
    text-decoration: none;
    color: white;
}

Answer №1

Utilizing CSS media queries allows you to tailor styles based on screen resolutions.

@media (max-width: 767px) {
  /*styles for mobile screens*/
}

@media (min-width: 768px) and (max-width: 991px) {
  /*styles for tablet screens*/
}

@media (min-width: 992px) and (max-width: 1199px) {
  /*styles for small desktop screens*/
}

@media (min-width: 1200px) {
  /*styles for large desktop screens*/
}

For a comprehensive solution, I suggest exploring Bootstrap as it comes with responsive design features and more.

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

Is it possible to display the footer only when I scroll to the very bottom of the page using ScrollMagic?

After browsing through numerous questions on StackOverflow similar to this one, I attempted various solutions but unfortunately, nothing seemed to work for me. :( Greetings! My current setup involves utilizing a MVC model in PHP. I'm incorporating ...

When the parent div contains at least four divs, show the scroll arrow containers

In my code, there is a parent div that holds multiple child divs. If the number of child divs within the parent div exceeds 4, I want to show the scroll arrow containers. If it's less than 4, then those arrow containers should not be displayed. The ...

Adjusting column sizes smaller than 1/12 within the Primeng flex grid in Angular 8

In using primeng grid, a common desire is to have 2 columns behave a certain way: the first column should take up 1/13 of the total space the second column should take up the remaining space. Many attempt different solutions like: <div class="p-g ...

Create a CSS mixin for calculating REM values that is not specific to font sizing or any particular element

Hello everyone! I have the following mixin and I am looking to make it a global one. What I mean is, without setting the margin, I want to use it for font-size for example, or for anything else that you might want to set into rem/em units. I am new to Le ...

`problem with moment.js incorrectly identifying the day of a given date`

I'm currently working with a field that has the value 03-01-2020, which is in the DD-MM-YYYY date format. However, when I apply the code moment.utc(document.getElementById('date').value, "DD-MM-YYYY HH:mm:ss").toDate(), I noticed that the re ...

CSS: Experimenting with creating a hover effect that lifts the box upwards

Hey there! I'm currently working on adding a red hover box for my Menu. The issue I am facing is that the hover box is displaying below the menu line. I am attempting to adjust the hover box to move a bit higher or up. You can view the image here: ht ...

Ways to display or conceal an anchor tag depending on the database value

I am facing an issue with my aspx page where I have a listview containing three tags - one for hotel invoice, the second for package, and the third for vehicle. Currently, all three tags are visible. What I want is for the visibility of the tags to chang ...

Storing a stylesheet on the identical server as the application through the Rails Asset Pipeline

Currently, I am utilizing a JavaScript library that necessitates a stylesheet to be located on the same domain as the application. My assets are being hosted on S3 via the Rails Asset Pipeline, and I would prefer to maintain this setup. I only require one ...

Tips on aligning the Three.js and HTML/SVG coordinate systems, particularly regarding the y-axis synchronization

I am currently integrating 3D content using Three.js with HTML and SVG content. The synchronization of placement between HTML, SVG, and the 3D world by Three.js's CSSLoader is quite effective. One challenge I have encountered is that the coordinate s ...

Optimal techniques for designing an HTML CSS navigation menu (using my float demonstration)

I'm trying to figure out how to create a menu that complies with the latest standards of HTML and CSS. I put together this code but was informed that using float is generally not recommended nowadays. However, I'm unsure of the reasons behind thi ...

When a radio button is checked, add a class to its parent element that has a specific class assigned to it

In order to dynamically add a class to a specific div element higher up the DOM hierarchy when a radio button is clicked, I am in need of assistance. There are multiple instances of these div elements with different radio buttons, so it is crucial that on ...

Customize a Bootstrap 4 card-deck layout to adjust the number of columns based on the viewport

I am currently working on implementing the card-deck feature in Bootstrap 4 to ensure that all my cards have the same height. Although the examples provided by Bootstrap showcase 4 stylish cards, they are always displayed as 4 cards per row, regardless of ...

Items that do not commence from the start of the list

I'm encountering an issue with my unordered list where the li elements are not rendering properly. The first element seems to have a margin, and I'm unsure why this is happening. How can I fix this problem? function App() { return ( < ...

Unable to utilize CSS for my navigation menu

I need some help tweaking my navigation bar using CSS, but for some reason, the changes I make in the CSS file are not reflecting on the actual page. Below is the HTML and CSS code snippets: HTML: <!DOCTYPE html> <html lang=en> <head> ...

Tips for maintaining the original ng-click initialized value as the ng-init value after the page is refreshed

My ng-repeat feature includes buttons for liking and disliking images. The problem I'm facing is that each time the page refreshes, the count of likes and dislikes gets reset to the initial value set by ng-init. How can I maintain the incremented lik ...

Why is only jQuery 3.2.1 or jQuery Mobile 1.4.5 being loaded?

When I load my html file, only jquery or jquery mobile is loading from the head. Changing the order in which they appear in the head causes a switch in which one is loaded. Is this possibly due to a compatibility issue? <head> <title& ...

Issues with fonts in Google Chrome Version 32.0.1700.76 m

After recently updating my Google Chrome browser, I noticed that some of the fonts are not displaying correctly. Interestingly, they appear fine on other browsers, but the issue only seems to occur in Chrome v32.0.17...76 m. The fonts I used were "Open Sa ...

Tips for retrieving ajax response data in html format using javascript or jquery

Picture this scenario: you have two files test.php index.php The test.php file only contains an HTML button with the ID "click". Meanwhile, the index.php file also has an HTML button, but with the ID "send". If an AJAX request is sent from index.php t ...

Downloading multiple files concurrently in Flask

I am currently working on implementing a feature in Flask that allows users to download files from the client side. This feature should support downloading multiple files or just a single file. However, I am facing a challenge in providing the option to d ...

display the chosen choices from the jquery tool

I have implemented a Jquery movie seat selection plugin on my jsp website successfully. It allows users to select seats with ease. However, the issue I am facing is that due to my limited knowledge of Jquery, I am unable to display the selected seats by t ...