What causes the styling to break in my CSS media query implementation?

Currently, I am working on making my sidebar fluid so that it adjusts with the browser window size. Everything seems to be going smoothly, except for one issue – when I add a media query to make it responsive, my CSS styling breaks. However, if I remove the query, everything reverts back to the normal styling from my stylesheet. Could someone please review my code and point out what might be causing this problem? Thank you in advance!

On another note, adding an additional closing curly brace to the #rightandoverview media query fixes the styling but disables the fluidity. What could possibly be causing this?"

#righthandoverview {
position: absolute;
top: 91px;
right: 0px;
width: 20%;
height:215px;
background-color: white;
webkit-box-shadow: 0px 4px 5px -5px #777;
-moz-box-shadow: 0px 4px 5px -5px #777;
box-shadow: 0px 4px 5px -5px #777;
}

@media screen and (max-width:830px) and (min-width:100px) {
#righthandoverview {
    float: left;
    width: 30%;
    background-color: yellow;
    margin-top: 5px;

}





#righthandoverview ul {
position: absolute;
display: inline;
float: left;
font-family: klavika-light;
list-style-type: none;
text-decoration: none;
white-space: nowrap;
}

@media screen and (max-width:830px) and (min-width:100px) {
#righthandoverview ul {
    float:left;
    width:30%;
    background-color: yellow;
    margin-top: 10px;

}
}




#righthandoverview ul li > a {
display: inline;
text-decoration: none;
color:#8BAFDA;
}   

#righthandoverview ul li {
padding-bottom: 6px;
}

Answer №1

It appears that you forgot to close a bracket in your initial media query.

@media screen and (max-width:830px) and (min-width:100px) {
#righthandoverview {
    float: left;
    width: 30%;
    background-color: yellow;
    margin-top: 5px;

}





#righthandoverview ul {
position: absolute;
display: inline;
float: left;
font-family: klavika-light;
list-style-type: none;
text-decoration: none;
white-space: nowrap;
}
}

Answer №2

It seems like there was a missing bracket in the code snippet below, but I have rectified it for you:


@media screen and (max-width:830px) and (min-width:100px) {
    #righthandoverview {
        float: left;
        width: 30%;
        background-color: yellow;
        margin-top: 5px;
    }
}

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

Scaling boxes responsively according to screen size utilizing Bootstrap

Creating a portfolio website with a carousel section to display completed projects in a 2x2 grid layout, transitioning to a 1x4 on smaller screens is proving to be quite challenging. After trying various methods from Bootstrap documentation and YouTube tut ...

Issue with min-height property in IE8 (and potentially other browser versions)

Trying to design a web page with 3 sections, each occupying 100% of the window height. Managed to make it work on Chrome, Firefox, and Safari, but facing compatibility issues with IE8 and possibly other versions. Test out the page here: Here's the H ...

What is the best way to adjust a component to display varying content based on the scenario?

I am looking for a way to reuse a component on my website that displays messages. The challenge is that in one section, the content consists of only a title and paragraph, while in another section, there are multiple titles and content pieces. I have imple ...

What is the best method to ensure a TALL table header is repeated on every page in Chrome?

First time poster =) I am currently facing an issue while trying to print a long table and have the table header repeat on each page. The problem arises when the height of the <thead> reaches a certain threshold, specifically 242px in Chrome 87.0.42 ...

Not considering CSS margins for nested DIVs

I recently acquired a classic bootstrap template that is structured like this: <div class="container"> <div class="row"> <div class="col-12"> ...header... <div class="carouselContainer"> ...carousel... ...

Using Node.js and Less to dynamically select a stylesheet source depending on the subdomain

Currently, my tech stack consists of nodejs, express, jade, and less. I have set up routing to different subdomains (for example: college1.domain.com, college2.domain.com). Each college has its own unique stylesheet. I am looking for a way to selectively ...

Incorporate new functions through the css class name "javafx"

On my dashboard, I have 10 labels that share the same CSS class for mouse over events. Now, I want to change the button style after it is pressed and remove the mouse over effect. How can I achieve this? ...

When hovering over .nav-item, the nav-link color remains unchanged

Is there a way to modify the code below to change the color of a navbar item to red when it is hovered over? .nav-item.active .nav-link{ color: blue !important; } .nav-item.hover .nav-link{ color: red !important; } ...

Crafty Checkbox Selector [ leveraging jquery ]

I have created some fake checkboxes using elements like <span> after the real checkbox and they are working fine! However, I am having trouble counting the checked checkboxes when a checkbox is clicked. I have tried using methods like: $(".elm:chec ...

Tips for troubleshooting a sass file that is not displaying changes in the browser

Currently working on my portfolio website using bootstrap and sass along with a theme kit. Initially, I attempted to implement a grid column style for the intro-section but had a change of heart and deleted the style. Surprisingly, every time I refresh my ...

Discover the steps to incorporate a glowing effect into your custom progress bar using JavaFX

After successfully creating a custom progress Bar in JavaFX, my next step is to incorporate a glow effect into the progressBar. To achieve this, I have constructed an ellipse with a Gaussian blur effect and integrated the centerX of the ellipse into a tim ...

Using JavaScript and HTML, create a click event that triggers a drop-down text

Can anyone help me with creating a dropdown feature using JavaScript, HTML, and CSS? I want to be able to click on the name of a project and have information about that project show up. Any suggestions on how I can achieve this? Thanks in advance! ...

Utilize JavaScript to implement CSS using an "if" statement

I am currently working on implementing iOS web app properties into my website. My goal is to create a <div> at the top of the page and apply specific CSS styles when a certain condition is met in a JavaScript script. Unfortunately, I am facing issue ...

Is it possible to adjust the left property following the concealment of an element with JQuery?

My goal is to move an image element using the 'left' property after hiding a div. To achieve this, I am using JQuery's '.promise()' function. Here is my code: HTML code: <div id="outerContainer"> <div id=" ...

What is the best way to line up a checkbox and its labels alongside a dropdown menu?

My index.html file has a header like this: https://i.sstatic.net/s0hAt.png I'm trying to align the checkbox and its label with the dropdown menu "In ordine". I'm using only bootstrap (no custom classes) and my current page layout is as follows. ...

custard stealth style of jquery's mobile CSS

Is there a way to switch the jquery mobile CSS to a desktop-friendly CSS when a user is not on a mobile device? I am looking for a platform or existing CSS that can accomplish this. ...

Create a Bootstrap layout with three columns and three rows, where the third column has a height

I am trying to achieve a specific layout using the col-lg-4 class. My main goal is to make the third column span across all three rows without creating excessive white space between them. The current layout looks like this: Is it possible to do this in B ...

How come it's so difficult to set the perspective camera to accurately display sizes in three js?

Currently, I am using Three Js to create a visual representation of a car. However, I am encountering an issue with the perspective camera that I can't seem to resolve. My goal is to make it appear more realistic by only showing the front of the car, ...

When the value in a required input field is empty, the border is activated and the color is styled

Can you please explain this to me? Try running this code in Firefox: http://jsfiddle.net/eMa8y/24/ Here is the HTML: <html> <head> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> </head> ...

Scrolling vertically using window.open functionality

I am trying to open a pop-up window using window.open. I would like the scrollbars to appear only if necessary. Unfortunately, in Safari, the scrollbars do not show up unless I include scrollbars=1 in the code. However, this also causes horizontal scrollb ...