What is the best way to eliminate padding: 0; in a sass file?

Currently, I am focusing on enhancing the responsiveness of the footer section on my website. To achieve this, I have implemented a media query that triggers when the screen size is reduced to less than 992px. This allows the content within the footer to be centered. However, I faced a dilemma where I needed to remove the padding in order to center the content for smaller screens, but retain it for normal-sized footers. How can I override the padding: 0; to achieve this goal?

Below is the code snippet for the normal footer design:

.social-media {
    margin-bottom: 50px;

    > ul {
      padding: 0;
      list-style: none;

      > li {
        > a {
        padding-right: 20px;
        float: left;
        color: #ffffff;
        }
      }
  }
}

And here is the code snippet for the small footer design:

@media screen and (max-width: 992px) {
  .social-media {
    margin-bottom: 0;
    height: auto;
    width: auto;

        > ul {
      list-style: none;
      text-align:center;

      > li {
                padding-left: 10px;
                padding-right: 10px;

                > a {}
            }
      }

  }
}

Additionally, below is the code snippet for the bootstrap column used in the footer:

<div class="col-lg-3 offset-lg-6 social">
  <div class="social-media">
    <ul class="nav-items">
      <li class="nav-item" :key="index" v-editable="item" v-for="(item, index) in $store.state.settings.footer_nav">
        <LinkType class="nav-link" :link="item.link" :linkText="item.name">{{ item.name }}</LinkType>
      </li>
    </ul>
  </div>
</div>

If anyone has any insights or solutions to my predicament, I would greatly appreciate the assistance as I have been grappling with this issue for some time now.

Answer №1

One way to make sure your CSS properties are applied is by using the '!important' declaration.

.social-media
{
margin-bottom: 50px;

> ul
{
  padding: 10px !important;
  list-style: none;

  > li
  {

    > a
    {
    padding-right: 20px;
    float: left;

    color: #ffffff;
     }
   }
    }
 }

@media screen and (max-width: 992px) {

               .social-media
                {

                    margin-bottom: 0;

                    height: auto;
                    width: auto;

                    > ul
                    {
                        list-style: none;

                        text-align:center;

                        > li
                        {
                            padding-left: 10px;
                            padding-right: 10px;

                            > a
                            {

                             }
                         }
                     }

 }

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 best way to utilize SCSS variables alongside data-attributes within Vue JS and Bootstrap Vue?

I'm currently working on implementing a Dark Theme button for my application that can change the entire theme with just one click. Although the functionality is already in place, I am exploring ways to make this process simpler and more efficient. So ...

The center alignment for content in my columns is not functioning

I have created a layout using the following HTML and CSS: <div class="container-fluid header"> <div class="row text-center"> <div class="col-md-6 red"> <h1>First</h1> ...

What is the best way to obtain SAPUI5 Explored designs?

I am working on implementing a sap.ui.Table in my project, similar to the one showcased in the SAPUI5 Explored app. The table I am trying to create should allow for multi-selection of items using checkboxes on the left side. However, after downloading th ...

"Enhance your forms with CoreUI's Vue.js input components

I'm currently using the CoreUI template for VueJS, but I need help retrieving the value from CInput. You can find more details about this on the following link: . I want to bind the input value similar to what is described here: https://v2.vuejs.org/ ...

Creating a two-column image gallery inside a div:

I need to organize a group of thumbnails into two columns with four thumbnails in each column, solely using CSS. The thumbnails are all structured as follows: <a href="..."><img /></a> Is it possible to achieve this layout through CSS r ...

The navigation is designed to only show up as I scroll down the page, but ideally it should be visible

I am trying to make the navigation bar appear on page load instead of when I scroll down the page. Currently, I am using this jQuery code: <script type="text/javascript> $(document).scroll(function() { if ($(this).scrollTop() == 20) { ...

Utilize Bootstrap to switch between 'collapse' and 'collapse in' depending on the device being used

I have a collapsible panel set to default "expand" (collapse in) and it is working well. However, I would like to make it "collapse" (shrink) for mobile and tablet devices. Is there any built-in feature in Bootstrap that can help me achieve this? <div ...

Can someone please show me the process of iterating through an array in vuejs?

I am trying to create a Vue.js method that loops through an array of objects and returns all the names in that array. However, I am not sure how to achieve this. The method implementation would look something like this: fruits =[ {name: "apple", calori ...

No response observed upon clicking on the li element within the personalized context menu

I created a custom context menu that pops up when you click on an li element within an unordered list. I'm trying to trigger an alert when clicking on an li item inside the context menu, but it's not working as expected. To handle this dynamic c ...

Issue with margin spacing not desired on Internet Explorer 7

Encountering an unusual issue in Internet Explorer 7 where the heading appears with excessive space from the top. This issue is exclusive to IE 7 and not present in other browsers or newer IE versions. Any suggestions on how to resolve this? Chrome Versi ...

Using relative positioning in CSS causes the div to move to a new line

Feel free to check out this demo I've created for reference: http://jsfiddle.net/jcb9xm44/ In a nutshell, the scenario involves two inline-block divs nested within a parent div: <div class="outer"> <div class="inner1"> Y & ...

Choose a node from descendants based on its attribute

I am working with an interface that switches between displaying different div elements. Each div element has their children arranged differently, and when the switch happens, I need to access a specific child node of the newly displayed div. However, I fin ...

A solution for optimizing accessibility by concealing anchor outlines in Internet Explorer and Firefox

Initially, I want to clarify that I acknowledge the fact that removing outlines impairs keyboard navigation. In contrast to Internet Explorer and Firefox, Google Chrome handles this issue by displaying outlines exclusively when the user interacts with the ...

Having trouble inserting an image using Vue?

I am having trouble understanding why only the first image loads, while the others do not. 1. <img :src="require('../assets/batatas.jpg')" :alt="item.title" /> 2. <img :src="'../assets/batatas.jpg'" ...

The background video is not working on iPhones, even though it was functioning properly in the past

After extensive searching, I have been unable to find a solution to my issue. I used an html5 video element as a background with success on both web and mobile platforms, until recently. I have tried adding all necessary attributes for compatibility and I ...

Vue: Implementing Data Refresh in Store Post-Login

I am encountering an issue with the data store "menus" not updating after a login. It seems that the object "loggedInUser" is not set before calling "getMenus". I'm unsure of what mistake I might be making here. PS! While debugging in Chrome, I notic ...

What steps should I take in modifying my existing code to use jQuery to set my div to a minimum height rather than a fixed height?

Could someone assist me in adjusting my div to have a min-height instead of a regular height? Whenever I click on the "Learn more" button, it extends past my div because the function is designed to set a specific height rather than an equal height. $.fn.e ...

Adjust the standard size of the IMG tag using CSS

I have a simple image tag with an incorrect URL http://jsbin.com/monivava/1/edit <img src="http://placekitten!!!.com/g/200/200"> The issue is that the default size for this unsuccessful image is 18x20 (at least in Webkit), but I want it to be 0px ...

Incorporating CSS styling to specific elements

I am facing an issue with a CSS rule that looks like this: div#tabstrip.tabstrip-vertical.k-widget.k-header.k-tabstrip div#tabstrip-4.k-content.k-state-active{ background-image: url("http://wwww.example.com/logo2.png") !important; background-posit ...

Concealing the rear navigation button within the material carousel

I have a material css carousel, and I am trying to hide the back button on the first slide. I attempted to use the code below from a previous post The following code snippet prevents the user from looping through the carousel indefinitely. Stop looping i ...