Sizing grids with Susy framework

My goal is to construct a grid layout utilizing the Susy plugins, but I'm encountering an issue where there is extra space present within it.

$susy: (
  gutter-position: after,
  container: 1280px,
  container-position: center,
  columns: 14,
  gutters: 0.6,
  global-box-sizing: border-box,
  last-flow: to,
  debug: (image: show),
  // debug: (
  //   image: show,
  //   color: rgba(#ccc, 0),
  //   output: background,
  //   toggle: top right
  // ),
  use-custom: (
    background-image: false,
    background-options: false,
    box-sizing: false,
    clearfix: false,
    rem: false
  )
);


.region {
        @include span(12 of 14);
        @include pre(1);
}

The desired width for the region div is precisely 1140px, but upon measurement, I notice that it extends to 1140px with two additional grid spaces visible in the screenshot. How can I eliminate these? https://i.sstatic.net/y4JPq.png

When measuring from the far right to the far left, the grid measures 1140px, however, when starting from the dark pink and ending at the last dark pink edge, it measures around 1112-1113px.

Answer №1

According to the information provided for the Susy feature called "debug":

The grid images displayed may not be completely accurate due to browsers struggling with sub-pixel rounding when it comes to background images. These images are intended for general debugging purposes and should not be relied upon for precise measurements. It is normal for the "to" side of your grid image (right side if your text flows from left to right) to appear a few pixels off.

When you adjust the size of the window, you may notice that the alignment occasionally becomes perfect as the columns align to exact pixel values.

It is important to note that sub-pixel rounding only affects background images and does not affect the actual layout of the elements on the page.

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

Using Django variable in li a:nth-child selector produces unexpected results

Currently, I am honing my web programming skills by working on a personal blog in Django. However, I have encountered a hurdle. My intention was to enable the webpage to recognize which menu element is active by passing an argument from views.py to the tem ...

Setting up the CSS loader in a Vue.js project using webpack

I am currently working on a new vue-cli project and have successfully installed the Pure.CSS framework using npm install purecss --save. However, I am struggling to seamlessly integrate, import, or load the css framework into my project. I am unsure of whe ...

Updating the appearance of selected radio buttons with CSS

Here is the code I am using to create a toggle switch instead of radio buttons, and it works great: .switch { display: block; float: left; -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; font-weight: bold; ...

How can I prevent an image from being resized or cropped using CSS?

Is there a way in CSS to crop an inline image that is 4000px wide so it fits the viewport, similar to background-size: cover but for inline images? My responsive site has a CSS rule for all images: img { max-width: 100%; height: auto; } I have tried ...

Aligning float:left divs vertically

I have multiple divs with equal widths but varying heights that I need to fit together tightly. When I set them to float left, they don't align vertically but instead line up at the bottom of the row above. Even with the example below, I want to eli ...

Enhancing navigation functionality using CSS

I have two separate pages with navigation included in both. This way, it's easier to edit the navigation menu once instead of doing so on each page individually. However, I am now facing uncertainty on how to implement the 'active' class usi ...

An unusual CSS phenomenon with z-index

I've encountered a peculiar issue with my z-indexing. I have an image positioned relatively with a z-index of 1, and it should be above my navigation that is positioned absolutely with a z-index of -1. The problem is that upon page load, the image ap ...

How can we assign various class names depending on the value of an object?

I have a set of objects stored in my component. I need to dynamically apply different classes based on the value of the ErrorLevel property within each object. If an object has ErrorLevel equal to 1, I want to assign the following classes to various elemen ...

The origin of the image is specified within the HTML document

I recently encountered an issue while trying to include images in my HTML file. When I used a local file path like background-image: url('file:///C:/Users/faycel/Desktop/site%20guide/paris.jpg'), the image displayed correctly. However, when I tri ...

Restricting the size of the component to match the height of its containing div

I set up a layout with a toolbar at the top, a sidenav on the left, and the remaining space for content. The sidenav consists of a searchbox and a list of items. My goal is to have the sidenav's height match the row it's placed in, allowing the ...

Contrasts between space and the greater than selector

Can you explain the distinction between selector 6 and selector 7 as outlined on the w3 website? Inquiring minds want to know. ...

Switching up icons using React Spring - a step-by-step guide!

Is it possible to change the icon when I click on it using react spring? For example, if I click on " ...

Bootstrap 4 rows causing dropdown clipping

I am experiencing a strange problem with Bootstrap 4 when using dropdown. I have additional actions listed in the dropdown menu that are supposed to be visible when clicking on the "plus icon". However, when I do click on the "plus icon", the dropdown ends ...

Tips for hiding a div only on mobile devices while always displaying it on large screens using AngularJS or CSS

How can I use Angularjs or css to hide a div on mobile devices only, ensuring that it is always displayed on large screens? ...

HTML & CSS: Modify background rectangle behind text to limit its size within the webpage dimensions

I'm experiencing a unique issue with the current code present in my HTML index file. <div class="titleMessage"> <div class="heading"> <p class="main">NAME HERE</p> <p class="sub">Software Engineer& ...

The text in Outlook for Windows emails is being obscured by a button that is overlapping it

As a newcomer to HTML email development, I've encountered an issue that has been puzzling me for the past few days. The problem lies in creating a two-column layout where the left column contains an image and the right column holds text along with a b ...

Can you explain the guidelines for overlapping CSS media queries?

When it comes to spacing out media queries accurately to prevent overlap, how should we approach it? Let's examine the following code as an example: @media (max-width: 20em) { /* styles for narrow viewport */ } @media (min-width: 20em) and (max ...

I'm having trouble understanding why I'm getting an error when trying to link CSS or SCSS

<link rel="stylesheet" type="text/css" href="scss/styles.scss"> <link rel="stylesheet" type="text/css" href="css/styles.css"> /*webpackconfig.js*/ var path = require("pat ...

Is there a way to conceal :before content in the parent element by hovering over the child element?

Here is the HTML code I currently have: <li *ngFor="let menu of menus" class="{{ menu.attributes.class }} menu-items" [attr.data-title]="menu.label"> <a [routerLink]="[menu.url||'/']" [queryParams]="menu.refParameter3 ? menu.refPara ...

When a user scrolls over an element with a data-attribute,

Looking to create a dynamic header effect on scroll? I have two headers, menu1 by default and menu2 hidden with display:none. In specific sections of my website, I've added a special attribute (data-ix="change-header") to trigger the header change. T ...