logo
down
shadow

Failed to make 100 div's inside a single div responsive with CSS/JavaScript


Failed to make 100 div's inside a single div responsive with CSS/JavaScript

By : user2950784
Date : November 17 2020, 11:58 AM
should help you out You should do it using pure CSS (no JS).
Instead of using float, you should just use display: inline-block, and use box-sizing: border-box to be free to add borders.
code :


Share : facebook icon twitter icon
Responsive Layout with multiple divs inside divs

Responsive Layout with multiple divs inside divs


By : wptomo
Date : March 29 2020, 07:55 AM
wish helps you I'm the author of PocketGrid, a micro CSS grid for responsive layouts.
As Luca suggested, you can use PocketGrid to make your layout.
code :
<div id="LAYOUT" class="block-group">
    <div id="HEADER" class="block">
        <div class="box">HEADER</div>
    </div>
    <div id="WORK_AREA" class="block-group">
        <div id="LEFT_BAR" class="block">
            <div class="box">LEFT_BAR</div>
        </div>
        <div id="CONTENT" class="block">
            <div class="box">CONTENT</div>
        </div>
    </div>
    <div id="TOOLBOX" class="block-group">
        <div class="TOOLBOX_ITEM block">
            <div class="box">TOOLBOX ITEM</div>
        </div>
        <div class="TOOLBOX_ITEM block">
            <div class="box">TOOLBOX ITEM</div>
        </div>
        <div class="TOOLBOX_ITEM block">
            <div class="box">TOOLBOX ITEM</div>
        </div>
    </div>
</div>
#LAYOUT { min-width: 800px; }
#HEADER { height: 30px; }
#WORK_AREA { width: 100%; }
#LEFT_BAR { width: 300px; }
#CONTENT {
    overflow: hidden; /* Trick to fill the remaining space */
    float: none;
    width: auto;
}
#TOOLBOX {
    min-width: 300px;
    width: 100%;
}
@media (min-width: 1100px) {
    #WORK_AREA { width: calc(100% - 300px); }
    #TOOLBOX { width: 300px; }
}
Single function to toggle multiple divs inside other divs individually

Single function to toggle multiple divs inside other divs individually


By : user2853585
Date : March 29 2020, 07:55 AM
I hope this helps you . I have some divs in my page, and each one of them has got a content I want to toggle via jQuery. This is actually how my code looks like: , You can check if div has specific class value like:
code :
//select div with class attribute starts with my_div
$('div[class^="my_div"]').click(function() {
  //find child element div with class start my_div_B
  $(this).children("div[class^='my_div_B']").slideToggle("slow");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="my_div">
  <img src='http://placehold.it/200x100' />
  <img src='http://placehold.it/200x100' />
  <div class="my_div_B">text</div>
</div>
<div class="my_div2">
  <img src='http://placehold.it/200x100' />
  <img src='http://placehold.it/200x100' />
  <div class="my_div_B2">text</div>
</div>
Make Image Height responsive inside responsive container

Make Image Height responsive inside responsive container


By : rocky parmar
Date : March 29 2020, 07:55 AM
I hope this helps you . I have a responsive image when I adjust width, but when I adjust height I get a scrollbar. How to make it responsive in a height as well? without making it background image? , You can do it like this:
code :
* {margin:0;padding:0;box-sizing:border-box} /* recommended */

html, body { /* modified */
  width: 100%;
  height: 100%;
  background: #000;
}

.container {
  position: fixed;
  bottom: 20px;
  left: 20px;
}

.menu {
  position: relative;
  /*max-height: calc(100vh - 50px);*/
  /*max-width: 100vw;*/
  background: #fff;
  overflow: auto;
  border: 2px solid black;
}

ul {
  display: flex;
  /*width: 100%;*/
  height: 40px; /* needs to be defined / adjust to your needs */
  list-style-type: none;
  padding: 0 0 10px 0;
  /*margin: 0;*/
}

li {
  display: flex; /* added */
  justify-content: center; /* added */
  align-items: center; /* added */
  flex: 1; /* modified */
  /*text-align: center;*/
  padding: 10px 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
}

li:hover {
  /*flex: 1 1 100%;*/
  /*text-align: center; already used */
  /*padding: 10px 0; already used */
  /*cursor: pointer; already used */
  background: rgba(0, 0, 0, 0.1);
}

img {
  display: block; /* recommended / removes the bottom margin/whitespace */
  max-width: 100%; /* modified / recommended: use images which are 350px (or whatever you want) wide by default */
  max-height: calc(100vh - 60px); /* mandatory / - the defined height of the ul which is 40px - bottom: 20px */
}
<div class="container">
  <div class="menu">
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
    </ul>
    <div>
      <img src="http://3.bp.blogspot.com/_EqZzf-l7OCg/TNmdtcyGBZI/AAAAAAAAAD8/KD5Y23c24go/s1600/homer-simpson-1280x1024.jpg" alt="">
    </div>
  </div>
</div>
How to make these divs responsive

How to make these divs responsive


By : Suraj Botre
Date : March 29 2020, 07:55 AM
will be helpful for those in need I am new to web development and so to Stackoverflow. I am stuck at changing width to make it responsive. , Check this one
code :
div {
  width: 280px;
  height: 140px;
  padding: 30px;
  margin: 10px;
  display: inline-block;
  background: green url(https://mdn.mozillademos.org/files/13090/colorful-heart.png) no-repeat center 0;
  background-size: contain;
}

.multiply {
  background-blend-mode: multiply;
}

@media only screen and (max-width: 767px) {
  body {
    text-align: center;
  }
  div {
    width: 48%;
    height: auto;
    margin: 15px 0;
    padding: 13% 0;
  }
}
<div></div>
<div class="multiply"></div>
Make divs inside table cells the same height without javascript

Make divs inside table cells the same height without javascript


By : Sebastian Pedersen
Date : March 29 2020, 07:55 AM
help you fix your problem I would like to make two divs contained in table cells in a shared row both have the height of the taller div. I would like to do this without JS. Here is a fiddle with a simplified example: http://jsfiddle.net/Lem53dn7/1/ , Add the following properties to your div rule:
Related Posts Related Posts :
  • clearvalidators not working in angular 6 form control
  • Remove Count Attribute in json data
  • queue up function callbacks
  • How to stop all Soundcloud streams in once?
  • Sliding div onclick left/right
  • RequireJS JQuery shim doesnt work with VS2013
  • What is the Meteor concurrency model?
  • Events on children of contenteditable element
  • Simple jquery not working to print the input value
  • Javascript templating language in reverse
  • Making Pagination in Javascript Scalable (for large # of db results)
  • Performance of Stateless Authentication in SPA and SSO (Single Sign On)
  • Assigning a value for view asynchronously
  • Mocha JS: How to reuse assertions within a spec?
  • Is ember.js stable enough to use in a real world project?
  • jQuery Load() not loading within div
  • encode stream from webCam h264
  • Regex to find pattern, return subpattern
  • Why does this regex to remove empty <p></p> tags from a string fail?
  • Rails: pass data to javascript
  • Quickest way to check if a number is in a set?
  • Phonegap events online/offline not working
  • In HTML5, please explain the meaning of '?' in the statement
  • Form to use AJAX rather than a page refresh but also utilise error handling?
  • JQuery Script looping error
  • different size divs align top left
  • Image fade-in when webpage finishes loading
  • Seeking HTML5 audio element causes delay (breaks sync)
  • How can I read & write data to a new tab in Firefox?
  • jQuery or JS turn all words into italic type
  • iOS css -webkit-transform: scale doesn't offset touch events
  • Populate select list using javascript
  • Can you work out why my .js file doesn't seem to be linking to my html?
  • Make slideToggle effect only one element at a time
  • Output sound using JavaScript
  • What is the analytics.js equivalent of _trackPageview found in ga.js
  • How can I check if a JS file has been included already?
  • hasClass and condition not working
  • EDITED: I'm having issues with a button and its function
  • Importing XML in HTML with javascript
  • Create new function in contentScriptFile in Firefox extension
  • Should I build Node.js from source or download the OS X installer?
  • How to enforce integer sizes in JS? (TypeScript?)
  • How to update the JSON object without deleting old values using javascript
  • Reading a javascript variable containing a string into another file
  • Possible to prevent 403 errors from logging to the web console?
  • Jquery Accordion - Expand and collapse div on hover
  • jquery .hide() function - Hide mobile, Display Desktop
  • Holding password in javascript variable - security implications?
  • JQPlot trouble to render vertical stacked bar and horizontal legend
  • counts days inbetween then add class to those days with nested divs?
  • Marionette.js with Rails (Devise) Authentication
  • javascript anonymous function evaluation idiom
  • Why am I losing the decimal when working this equation in Javascript?
  • Site redirects to index.php after being open while making calls to an API using AJAX
  • How to determine when multiple callbacks are all done
  • How to update Yeoman dependencies?
  • How can I do a /resolve with the Soundcloud Javascript SDK?
  • I'm not able to call a named callback function
  • How to get value of Paragraph element contained in <div> in HTML using JavaScript
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org