The appearance of my website appears differently depending on the resolution

Just recently, I began exploring the world of HTML/CSS/JS and created a handy tool for my personal use. However, I encountered an issue when viewing it on different resolutions which caused some elements to look distorted.

The tool I made allows me to input a band's name and genre, add it to a list, but the layout gets messed up when adding bands to the list. The text extends all the way to the right side of the screen, making the border appear as a tiny square.

In addition, I am looking to implement a feature where I can click on a band from the list to highlight it and have a remove button to delete it. But I'm not sure where to begin with this functionality.

Here is a snippet of the code:

<!DOCTYPE html>
<html>
    <head>
        <link type="text/css" rel='stylesheet' href='stylesheet.css'/>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="script.js"></script>
    </head>
    <body>
        <h2>Bands I Like</h2>
        <form name="checkListForm">
            <input type="text" id = "Item" name="checkListItem"/>
        </form>
        <div id="button">Add!</div>
        <br/>
        <div class="list"></div>

        <ol class = "Header">
            <li>Band // Genre</li>
        </ol>
        <br/>
        <ol class ="Bands">

        </ol>


    </body>
</html>

Any assistance or guidance on improving this would be highly appreciated!

Answer №1

Your CSS contained a rule that was causing the alignment to shift right.

margin: 4px 750px;

To resolve this, you simply needed to float the links to the left so they would be covered by the border:

.bands{
    float:left;
}

If you want to see the updated code in action, check out this link: http://jsfiddle.net/mLkcr501/1/

Thanks,

Answer №2

It is necessary to implement media queries in order to adapt the size for various resolutions.

@media (max-width: 640px){
    'insert class or id selectors here'{width:100%; float: left;}
    .greyBox2{display:none;}
    .text{width: 100%; text-align: left; font-size: 17px;}
}

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

Exploring a JSON file to generate a customized array for implementing autocomplete functionality in jQuery

I'm currently working on developing an autocomplete feature for a search bar that will display names of places in Norway. The data is being fetched from a REST API URL provided by a third party. As an example, when the input is "st" there are two res ...

Is there a regular expression that can be used to extract sentences from HTML

As I delve into the world of HTML parsing, I'm starting to understand that using regular expressions for this task is not always the best approach. However, in my Perl class, I am currently experimenting with utilizing regular expressions to extract a ...

Can the href values within <a> tags be altered based on the existing href value?

I am currently in the process of integrating Video JS and Colorbox. My objective is to utilize jQuery to easily modify all href values that contain ".mp4" by replacing it with ".html". This modification will enable the existing code to function smoothly, ...

How do I programmatically switch the Material-UI/DatePicker to year view in React?

I have a DatePicker component set up in my project, and it works perfectly fine. However, for my specific use case, I only need the year view to be displayed. Within the child component of the DatePicker (Calendar), there is a function called: yearSelect ...

Is it allowed to use an ID as a variable identifier?

One method I often use is assigning a variable with the same name as the id of an element, like this: randomDiv = document.getElementById("randomDiv"); randomDiv.onclick = function(){ /* Do something here; */ } randomDiv.property = "value"; This tech ...

Utilizing variable values in HTML and CSS to enhance a website's functionality

My current project involves modifying an HTML web resource for use in Dynamics 365. I need to replace a static URL with a dynamic value obtained via Javascript, specifically: var URL = Xrm.Page.context.getClientUrl(); There are multiple instances within ...

Issue with CakePdf unable to properly render CSS styling

I am having issues with the CakePdf Plugin (CakePdf.DomPdf) as it is not recognizing my stylesheet. Despite copying my /View/Layouts/default.ctp to /View/Layouts/pdf/default.ctp, the pdf file generated does not reflect the styling. Could this be due to t ...

What's better in React: using pure components or non-pure components? Is it okay to fetch data in componentDidMount or

Exploring React in Meteor has led me to observe two distinct approaches... Take the meteor leaderboard example, where a list of players displays their names and scores. The pure approach involves fetching all players and passing them into the playersList ...

Forwarding images from a server to a client using socket.io and node.js

I am encountering an issue where I am trying to receive an image via socket.io in node.js and then forward it to a client (browser). However, the image sent through the message to the browser is not being recognized or displayed. Interestingly, if I save ...

Ways to retrieve the responseText within the jqxhr.complete callback function

Apologies in advance for my lack of knowledge in JavaScript and jQuery, this question may seem basic. I've searched through the jQuery documentation and Google but couldn't find an answer. I am attempting to trigger an action on the response onc ...

No data found in Node.js after receiving AngularJS POST request

I've been working on sending a straightforward POST request to my server using AngularJS. The request successfully goes through and reaches the controller on the backend, but strangely, req.data is appearing as undefined. Front End Controller: funct ...

Is it considered acceptable to include a stylesheet inside the <body> element?

When dividing my web pages into sections, such as headers and content, I find it challenging to avoid placing links to external stylesheets within the <body> tags. I prefer not to combine all styles into one large file or include all stylesheets in ...

Utilizing inline styles with the asset pipeline feature in Rails

<%= link_to root_path do %> <div class=""> <div style="background-image:<%= image_tag " image1.png "%>"> </div> <div> <h2>Title</h2> <p>Paragraph</p> </div& ...

Getting started with TinyMCE in Nuxt: A step-by-step guide

I need to incorporate this script into my Nuxt code: <script> tinymce.init({ selector: "#mytextarea", plugins: "emoticons", toolbar: "emoticons", toolbar_location: "bottom", menubar: false ...

Adjusting form elements with Javascript

I'm looking to refresh my knowledge of JS by allowing users to input their first and last names along with two numbers. Upon clicking the button, I want the text to display as, "Hello Name! Your sum is number!" I've encountered an issue in my co ...

An effective way to utilize the h() function in Vuejs to render a component instance

I'm currently working on a Vuejs component setup that resembles the following structure: <template> <button @click="generateItem()">Add item</button> <div class="container"></div> </template> ...

What are the steps for implementing middleware that relies on a socket connection?

Using express.io, I am currently working on creating a middleware that necessitates a connection to a remote server through two sockets. However, I have encountered an issue. var net = require('net'); module.exports = function (host, port) { ...

Learn how to rearrange the order of Vue elements

I am working with a specific object structure in my code: lines: [{ order: '1', text: ' blue' },{ order: '2', text: 'green' },{ order: '3', text: 'yellow' }] Currently, thi ...

What could be the reason behind the failure of my inner div to successfully implement the flex-row

I'm currently trying to position two divs next to each other horizontally, and my concept was to utilize flexbox, but including the property flex-row doesn't seem to yield any results and I can't comprehend the reason behind it. How can I a ...

Is it possible to change all text to lowercase except for URLs using .tolowercase()?

Currently, I am facing a challenge with my Greasemonkey script. The use of .tolowercase() is causing all uppercase letters to be converted to lowercase, which is disrupting URLs. I have explored alternatives like .startswith() and .endswith(), considering ...