logo
down
shadow

Set collapsing priority without applying flex to CSS items?


Set collapsing priority without applying flex to CSS items?

By : Rubeus024
Date : November 28 2020, 11:01 PM
hope this fix your issue So this what I can conjure up with flexbox - I guess this will get you started:
code :
ul > li:first-child {
  flex: 0 1 auto;
}
ul > li:nth-child(2) {
  flex: 0 1 auto;
}
ul > li:nth-child(3) {
  flex: 0 2 auto;
}
ul > li:nth-child(4) {
  flex: 0 3 auto;
}
ul {
  list-style-type: none;
  display: flex;
  padding: 0;
  margin: 0;
}
ul > li {
  white-space: nowrap;
  padding: 5px;
}
ul > li:not(:last-child) {
  border-right: 1px solid;
}
ul > li:not(:first-child) {
  overflow: hidden;
  text-overflow: ellipsis;
}
ul > li:first-child {
  flex: 0 1 auto;
}
ul > li:nth-child(2) {
  flex: 0 1 auto;
}
ul > li:nth-child(3) {
  flex: 0 2 auto;
}
ul > li:nth-child(4) {
  flex: 0 3 auto;
}
<ul>
  <li>one is the 1st number</li>
  <li>two is the 2nd number</li>
  <li>three is the 3rd number</li>
  <li>four is the 4th number</li>
</ul>


Share : facebook icon twitter icon
Collapsing priority in Bootstrap

Collapsing priority in Bootstrap


By : becky06
Date : March 29 2020, 07:55 AM
seems to work fine I have four wells in two rows. Here's my code: , You can do it like this...
code :
<div class="container">
    <div class="row">
        <div class="col-md-8">
            <div class="well"><h1>1</h1></div>
            <div class="well"><h1>2</h1></div>
        </div>
        <div class="col-md-4">
            <div class="well"><h1>3</h1></div>
            <div class="well"><h1>4</h1></div>
        </div>
    </div>
</div>
Applying nth-child() when flex items are in column-reverse

Applying nth-child() when flex items are in column-reverse


By : tulla
Date : March 29 2020, 07:55 AM
I wish did fix the issue. If the :nth-child() selector works as intended with flex-direction: column, then...
The :nth-last-child() selector should work with flex-direction: column-reverse:
code :
.flex-container {
  display:flex;
  flex-direction:column-reverse;
}

.flex-item:nth-last-child(n+4) {
  background-color: lightgreen;
}
<div class="flex-container">
  <div class="flex-item">First</div><!-- Posted 4 days ago -->
  <div class="flex-item">Second</div><!-- Posted 3 days ago -->
  <div class="flex-item">Third</div><!-- Posted 2 days ago -->
  <div class="flex-item">Fourth</div><!-- Posted 1 day ago -->
  <div class="flex-item">Fifth</div><!-- Posted today -->
</div>
Applying margin to flex items

Applying margin to flex items


By : Arvind Elayappan
Date : March 29 2020, 07:55 AM
hope this fix your issue There's a problem with the selector you're using to apply the bottom margin:
code :
.left,
.right,
.middle * {
    margin-bottom: 25%;
}
.left *,
.right,
.middle * {
    margin-bottom: 25%;
}
Applying order property to flex items in different containers

Applying order property to flex items in different containers


By : Kalyana Chakravarthy
Date : March 29 2020, 07:55 AM
I hope this helps you . With your current HTML structure, that is not possible.
The order property applies only to flex items that are siblings in the same flex container.
Collapsing animation looking weird when collapsing flex-column navigation

Collapsing animation looking weird when collapsing flex-column navigation


By : Juan Carlos Namoc Gu
Date : March 29 2020, 07:55 AM
it helps some times I am trying to make a navigation in the sidebar using the bootstrap 4-framework, which is shown on the top of the page on small devices. , Bootstrap4 has a .nav class with these rules:
code :
.nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}
#navbarContent.nav{
  flex-wrap:nowrap;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<style>

.sidebar {
  background-image: linear-gradient(180deg, rgb(33, 243, 96) 0%, #077710 70%);
}

.sidebar .navbar-brand {
  font-size: 1.1rem;
}

.nav-item {
  font-size: 0.9rem;
  padding-bottom: 0.5rem;
}

.main {
  flex: 1;
}

.main .top-row {
  background-color: #e6e6e6;
  border-bottom: 1px solid #d6d5d5;
}

.nav-item:first-of-type {
  padding-top: 1rem;
}

.nav-item:last-of-type {
  padding-bottom: 1rem;
}

.nav-item a {
  color: #d7d7d7;
  border-radius: 4px;
  height: 3rem;
  display: flex;
  align-items: center;
  line-height: 3rem;
}

.nav-item a.active {
  background-color: rgba(255, 255, 255, 0.25);
  color: white;
}

.nav-item a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.content {
  padding-top: 1.1rem;
}

.navbar-toggler {
  background-color: rgba(255, 255, 255, 0.1);
}



.main .top-row {
  display: none;
}


/* Burger-icon animation */

.navbar-toggler {
  position: relative;
}

.navbar-toggler:focus,
.navbar-toggler:active {
  outline: 0;
}

.navbar-toggler span {
  display: block;
  background-color: #444;
  height: 3px;
  width: 25px;
  margin-top: 4px;
  margin-bottom: 4px;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  position: relative;
  left: 0;
  opacity: 1;
}

.navbar-toggler span:nth-child(1),
.navbar-toggler span:nth-child(3) {
  -webkit-transition: transform .35s ease-in-out;
  -moz-transition: transform .35s ease-in-out;
  -o-transition: transform .35s ease-in-out;
  transition: transform .35s ease-in-out;
}

.navbar-toggler:not(.collapsed) span:nth-child(1) {
  position: absolute;
  left: 12px;
  top: 10px;
  -webkit-transform: rotate(135deg);
  -moz-transform: rotate(135deg);
  -o-transform: rotate(135deg);
  transform: rotate(135deg);
  opacity: 0.9;
}

.navbar-toggler:not(.collapsed) span:nth-child(2) {
  height: 12px;
  visibility: hidden;
  background-color: transparent;
}

.navbar-toggler:not(.collapsed) span:nth-child(3) {
  position: absolute;
  left: 12px;
  top: 10px;
  -webkit-transform: rotate(-135deg);
  -moz-transform: rotate(-135deg);
  -o-transform: rotate(-135deg);
  transform: rotate(-135deg);
  opacity: 0.9;
}

#navbarContent.nav{
  flex-wrap:nowrap;
}




 @media (min-width: 768px) {
    contentwrapper {
        flex-direction: row;
    }
    .main{
        position: absolute;
        width: calc(100% - 250px);
        margin-left: 250px;
        float: right;
    }
    .sidebar {
        width: 250px;
        height: 100vh;
        position: fixed;
        top: 0;
        overflow-y: scroll;
    }
    .main .top-row {
        position: sticky;
        top: 0;
    }
    .main > div {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
    .navbar-toggler {
        display: none;
    }
    .sidebar .collapse {
        display: block;
    }
} 

</style>

<contentwrapper>
    <div class="sidebar">
      <div class="top-row pl-4 navbar navbar-dark">
        <a class="navbar-brand" href="">MyTestPage</a>
        <button class="navbar-toggler navbar-toggler-right collapsed" data-toggle="collapse" data-target="#navbarContent" aria-expanded="false" type="button">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
      </div>
      <ul class="nav flex-column collapse" id="navbarContent">
        <li class="nav-item">
          <a class="nav-link active" href="#">
                        Home
                    </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">
                        Page1
                    </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">
                        Page2
                    </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">
                        Page3
                    </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">
                        Page4
                    </a>
        </li>
      </ul>
    </div>
    <div class="main">
      <f:render section="Main" />
    </div>
  </contentwrapper>
Related Posts Related Posts :
  • Align single and double-line containers
  • padding on child element moves parent element - CSS
  • HTML Video autoplay not working with bxSlider on Chrome
  • Why is the W3 Validator stating that there is a closing </p> with no opening one?
  • Image 100% height of container - min-height behaves differently on Chrome/Safari
  • Unable to send canvas div to front
  • IE creates unnecessary offset on menu subitems
  • External media query for CSS not working in Chrome
  • Bootstrap align an item to left of a button
  • dynamic updating of HTML5 canvas
  • CSS: Deleting and ignoring respectively all previous properties?
  • h1, h2, h3 around Microdata markup
  • Angular 2 Checkbox Two Way Data Binding
  • Image to Fit Containing Div
  • Fixed width for table first column
  • How can I alter the formatting of pandoc footnote marks?
  • push is not a function Angularjs error
  • Angular2 Call method in Template
  • Stop playing video in iframe when modal is closed
  • Bootstrap. Can't change navbar link color. Even with ID
  • Making a position:absolute div stay in place on page resize
  • Can we reference contents of <defs> across multiple <svg> elements?
  • Kendo Chart Databinding - Local Json Data with schema
  • Box shadow appearing from right to left
  • BEM element nest naming and sass rule
  • How to vertically center text next to image?
  • Responsive full width input with button
  • Make three headings in line. One to be on the left, second on center and third on the right?
  • XPath for all child elements before a certain sibling?
  • How to prevent default Css scroll onclick and allow javascript event only?
  • CSS Media Query not accounting for screen density?
  • How to stop second navbar from overlapping fixed navbar at the top of the page
  • List Indentation same x-cord as header
  • Sending file input doesn't work
  • Scale div padding according to screen width
  • Flexbox doesn't work in summary tag
  • CSS - mobile responsive issue with absolute positioning
  • Align image slider at the same bottom using css (Slick Carousel library)
  • Input border CSS
  • Define a custom <a> tag in CSS?
  • How to write vertical text from bottom to top without using transform rotate?
  • Text sometimes warping, sometimes not
  • CSS Correctly positioning pseudo element
  • Center Cropping Image
  • How to wrap a block around a div tag?
  • How to make a tight cell around text and expand empty ones?
  • make exact padding on text
  • position:relative started working different than at first (asp.net)
  • Html does not display in 1/2 columns
  • Positioning shapes to website
  • overwrite another tag in CSS
  • How to calculate sum on change?
  • Why do the browsers automatically wrap text of a web page without any indication about how to do it?
  • Sizing and positioning a border property
  • How do I float div's to the bottom of a page?
  • Responsive html with absolute position text inside relative positon picture
  • Flexbox doesn't work in IE 10
  • AngularJS shopping cart app: Disable button when quantity < 2
  • How to select element by order ? - Css
  • How to apply animation on the list items such that during an instance of time only one list item is visible?
  • shadow
    Privacy Policy - Terms - Contact Us © soohba.com