Issues with media queries not being responsive

Struggling to finalize the design of this website

The font-face for the header in the menubar (at the top sof style.css) is not working. The media queries (at the bottom of style.css) are not working.

Despite trying various solutions from stackoverflow and other online forums, no progress has been made.

Sharing the css code and the header section of the html in hopes of finding a resolution.

@font-face {
    font-family: 'OldEnglish';
    src: url('../fonts/olde_english_regular/OldeEnglishRegular.eot');
    src: url('../fonts/olde_english_regular/OldeEnglishRegular.eot?#iefix') format('embedded-opentype'),
         url('../fonts/olde_english_regular/OldeEnglishRegular.woff2') format('woff2'),
         url('../fonts/olde_english_regular/OldeEnglishRegular.woff') format('woff'),
         url('../fonts/olde_english_regular/OldeEnglishRegular.ttf') format('truetype'),
         url('../fonts/olde_english_regular/OldeEnglishRegular.svg#OldEnglish') format('svg');
    font-weight: normal;
    font-style: normal;
}

.navbar-brand{
font-family: "OldEnglish";
font-size: 30px;
}

.copyright{
position:fixed;
bottom: 10px;
right: 10px; 
font-size: 12px;
background:rgba(255,255,255);
padding:3px 12px;
border-radius: 4px; 
border: 1px solid #ccc;
opacity: 0.8;
transition: 0.5s;
}
.copyright:hover{
background-color: rgba(0,0,0,0.8);;
color: #fff;
opacity: 1;
}
.committeedrop{
padding: 7px 7px;
min-width: 332px;
}
.contactdrop{
padding: 7px 0px;
min-width: 800px;
background-color:#fff !important;
}

#custom-bootstrap-menu.navbar-default .navbar-brand {
    color: rgba(255, 255, 255, 1);
}

.label-as-badge {
    border-radius: 1em;
    font-size: 12px;
    line-height:12px;
}

.inlineblock{
display:inline-block;
}

.navbar-brand img{
height: 40px;
width: 40px;
display: inline-block;
vertical-align: top;
bottom: 10px;
position: relative;
border-radius: 6px;
}

.mb20{
margin-bottom:20px;
}

.m0{
margin:0px;
}
.ml3{
margin-left:3px;
}

.panel300{
max-height: 300px;
overflow: hidden;
overflow-y: auto;}
}
.panel600{
max-height: 600px;
overflow: hidden;
overflow-y: auto;}
}

@media all and (max-width:767px) {
body{background-color: gray;}
    .contactdrop{ min-width:300px !important;}
    .contactdrop iframe{display:none;}
    .panel300,.panel600{min-width:initial;}
}
<html xmlns="http://www.w3.org/1999/xhtml" ng-app="nsc">
<head>
        <meta charset="utf-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <meta name="description" content="Numismatic Society of Calcutta"/>
        <meta name="author" content="Numismatic Society of Calcutta"/>
        <link rel="icon" href="image/Favicon/favicon.ico"/>
    
        <title>Numistmatic Society of Calcutta</title>
    
        <!-- Bootstrap core CSS -->
        <link href="css/bootstrap.min.css" rel="stylesheet"/>
    <link href="css/style.css" rel="stylesheet"/>
    
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
  </head>

** Updated Snippet *** Font face issue has been resolved. Thank you! Here is the updated snippet with the working font-face solution.

Answer №1

You've got extra curly braces appearing twice before the media CSS in the definitions for .panel300 and .page1600.

.panel300{
    max-height: 300px;  
    overflow: hidden;
    overflow-y: auto;
}
.panel600{
    max-height: 600px;  
    overflow: hidden;
    overflow-y: auto;
}

To correct this, remove the additional curly braces as shown below:

.panel300{
    max-height: 300px;  
    overflow: hidden;
    overflow-y: auto;
}
.panel600{
    max-height: 600px;  
    overflow: hidden;
    overflow-y: auto;
}

Additionally, after checking the browser console, it seems that there is an issue with your font path. Please refer to the screenshot provided at screenshot.

Lastly, ensure to update your doctype to:

<!DOCTYPE html>

Answer №2

For me, I simply replaced the DOCTYPE tag with <!DOCTYPE html>.

You can stick to just using .ttf or .otf when it comes to font extensions, no need to include every one.

Answer №3

It appears that the path is incorrect as a result of encountering a 404 error. Consider using the absolute URL for the src property instead of relying on relative paths. Alternatively, you can provide us with the absolute path to the font so we can verify accessibility.

Answer №4

Your font may not be accessible, which could be why it's not functioning properly. Please take a moment to review it. You can check it out here:

If you are using Wordpress, you may find this article helpful:

Here is an example of how to write your media queries:

@media (max-width: 768px) {
.body{background-color: gray;}
.contactdrop{ min-width:300px !important;}
.contactdrop iframe{display:none;}
.panel300,.panel600{min-width:initial;} }

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

What is the reason behind negative numbers appearing as "5-" rather than "-5" in the basic calculator coded using HTML and JavaScript?

As I am practicing my coding skills, I encountered an interesting issue. Any operation that results in a negative number displays as wrong, but when using console.logs it shows the correct result. Can someone explain why this is happening? <!DOCTYPE h ...

Looking for ways to ensure React is responsive and feeling a bit challenged by the React mentality?

I'm still getting the hang of ReactJS, and I've been facing some challenges with making React components responsive. For my app, I am utilizing react-tabs. It works well when the screen is wide, but I need to switch to a hamburger panel layout w ...

Issue with dropdown validation (button remains disabled)

I am working on creating a simple input form with validation requirements. Specifically, I want the button to be enabled or disabled based on the selection made in a dropdown menu. constructor(public fb: FormBuilder) { } /** * Form */ ...

Replace the arrow and implement collapsible div using CSS

My HTML code has the following structure: <ul id="urlcss"> <li class="nav-submenu"> <a class="collapsed" href="#" data-toggle="collapse" data-target="#submenu0"> ...

The submission of the form with the ID "myForm" using document.getElementById("myForm").submit() is

<form name="formName" id="formName" action="" method="post" autocomplete="off"> <input type="hidden" name="text1" id="text1" value='0' /> <input type="button" name ="submit" onClick="Submit()" value="submit"> ...

Css can be quite finicky when it comes to responsiveness

I'm currently working on a project and I've run into an issue where the CSS gets messed up when I resize the window. I'm struggling to make it responsive while still maintaining the desired look. Even after switching to rem units, the probl ...

Display Title Tag on Hover Effect using jQuery

I have currently utilized jquery to hide my title tags using the following code snippet: /** To hide the title tag that displays on hover **/ jQuery('document').ready(function($){ $('[title]').removeAttr('title'); }); ...

Utilize socket.io to send information from a nodejs server to an html webpage

I've been working on transferring data from Node.js to HTML using socket.io. Initially, I successfully transferred text from Node.js to HTML with the following code: Node.js code : app.post('/timer', function(req, res){ ...

The page appears to be too wide for its intended dimensions

Currently, I am developing a single-page website located at . The issue I am facing is that the page appears larger than 100% despite there not being any code elements causing this distortion. To create this website, I am utilizing PHP for fetching Faceboo ...

Experiencing issues with the redirect button on the navigation bar of my website

Video: https://youtu.be/aOtayR8LOuc It is essential that when I click a button on my navigation bar, it will navigate to the correct page. However, since the same nav bar is present on each page, it sometimes tries to redirect to the current page multiple ...

How to Handle Tab Navigation on a Mobile Website without Javascript?

My website primarily targets mobile devices, with tabs in the top navigation. Currently, these tabs are hard coded instead of utilizing Javascript. We want to ensure our site is accessible on all mobile devices, including those without Javascript support. ...

Transforming an Associative Array into a Structured Table

I have a task of converting an Associative Array into an HTML Table. This is how the Array is structured: Array ( [] => Harvest_Project Object ( [_root:protected] => project [_tasks:protected] => Array ( ) ...

Bootstrap allows for placing three radio buttons in each row within an ASP radio button list

Is it possible to display three radio buttons from the asp:RadioButtonList rblbase in one row, similar to the code below? <div class="row"> <div class="col-sm-4"> Radio1 </div> <div class="col-sm-4"> Radio2 </div> &l ...

The clearfix method seems to be ineffective when dealing with elements positioned absolutely

I have a div with position absolute and float left and right. I am trying to add an image below this div. The issue I am facing is that the image is overlapping with the first div. I want the image to be displayed below the first div without any overlap. ...

Tips for maintaining image dimensions on the screen using html and css?

Hello everyone! I am excited to be diving into the world of html and css, as I have a course lined up for next month. However, I currently have a project that I need to tackle on my own. One issue I'm facing is keeping the products within the screen s ...

What is the best way to adjust the picture dimensions when switching to a different image?

I've been working on creating a slideshow using CSS, HTML, and Javascript. Everything seems to be running smoothly, but I've noticed that when I click on the next or previous buttons, the current image enlarges and lingers on the screen for a few ...

The interaction between jQuery Masonry and Bootstrap results in unexpected grid behavior

I've spent hours trying to solve this problem, but I can't seem to get it to work as intended. I want the layout of my boxes to be like this using Bootstrap grids: However, after implementing the jQuery Masonry plugin (which I used to manage va ...

How can I dynamically assign @ViewChild('anchor_name') to a newly updated anchor element in Angular 2+?

Upon receiving an item through a GET request, I set the item_id upon subscription. In the HTML file, I create a div with an anchor id="{{this.item_id}}". However, I encountered the following error: FeedComponent.html:1 ERROR TypeError: Cannot read propert ...

Display or conceal the grid template row for content that is empty or if the grid area is not displaying

display: grid; grid-template-columns: var(--side-bar-width) 1fr; grid-template-rows: 60px 1fr 90px; gap: 0px 0px; grid-template-areas: "Sidebar Header" "Sidebar Body" "Player Player"; I ...

Guide on clearing an email input field in JavaScript after it has been filled with white spaces, when setting the value to an empty string ("") does not produce the desired result

When attempting to clear an input (type="email") filled with only white spaces using JavaScript, the cleaning process does not function as expected. Check out the code snippet below (link): <input type="email" id="myEmail" placeholder="Enter e-mail" au ...