Home > Enterprise >  Find out the width of the pagination for CSS media query
Find out the width of the pagination for CSS media query

Time:05-09

I am using Bootstrap for a project. For a content element I have created a card. In the card header I use col-md-9 for the headline. By default the height should be 45px. Since the page is supposed to be responsive, I tried to set the height to Automatic from a certain screen width using the media query (@media) in the CSS. However, the problem is that each heading is different in length and thus the point of the wrap of this changes. The goal is that as soon as the heading makes a break the header jumps to height: auto; in CSS. Does anyone know advice?

Thanks a lot!

<div >
  <b >Hello together, this is an long text. It should serve as an example and flood this bar with text. 1234567890</b>
  <div ><a  data-bs-toggle="collapse" href="#collapseExample" role="button"
      aria-expanded="false" aria-controls="collapseExample"><span ><i ></i></span></a>
    <a  href="#"><span ><i ></i></span></a>
  </div>
</div>

Here is the link to a sandbox with the code: https://codepen.io/goodyman97/pen/xxpMBbx

CodePudding user response:

You can try adding more breakpoints to get the desired result. Here are some popular breakpoints that are used when using a mobile-first approach:

/* Extra small devices (phones, 600px and down) */ @media only screen and (max-width: 600px) {...}

/* Small devices (portrait tablets and large phones, 600px and up) */ @media only screen and (min-width: 600px) {...}

/* Medium devices (landscape tablets, 768px and up) */ @media only screen and (min-width: 768px) {...}

/* Large devices (laptops/desktops, 992px and up) */ @media only screen and (min-width: 992px) {...}

/* Extra large devices (large laptops and desktops, 1200px and up) */ @media only screen and (min-width: 1200px) {...}

  • Related