html css responsive

How to achieve this layout please somebody help do me I have made some part of it #css #html #front-end
No description
47 Replies
Jochem
Jochem•7mo ago
please give #How To Ask Good Questions a look and share your code in a way people can see in their own browser (preferably codepen)
roger
rogerOP•7mo ago
No description
roger
rogerOP•7mo ago
Html-<div class="gap"> <div class="form-group"> <div class="dropdown"> <img class="search-icon" src="./assets/icons/searchicon.svg" alt=""> <input type="search" id="search-box" button class="btn btn-default dropdown-toggle" placeholder="placeholder" data-toggle="dropdown" > <img class="dropdown-icon" src="./assets/icons/vectordropdown.png" alt=""> </div> </div> <div class="right-border"> <div class="right-header"> <h2>Selected Segments</h2> <button>Clear all</button> </div> <div class="selected-segments"> <ul> <li>Lorem</li> <li>Lorem Ipsum</li> <li>Lorem Ipsum amet</li> <li>Lorem Ipsum amet</li> I have used flex still left side drop down is not taking 50% of space and the right side is taking the whole space maybe because ul li How can I make it 50-50%
Melodium
Melodium•7mo ago
please put the complete code and in codeblocks
MarkBoots
MarkBoots•7mo ago
i see in this screenshot you are using codepen. if you log-in and save, you can share the link with us
roger
rogerOP•7mo ago
This is complete code Thanks in advance
Melodium
Melodium•7mo ago
uhh but it looks incomplete tho 😕 lemme check the codepen anyways
roger
rogerOP•7mo ago
It’s complete for the part I want the solution for
Melodium
Melodium•7mo ago
well ok uhh i think i might not be able to help you, an experienced person will help you i apologize 😓
Jochem
Jochem•7mo ago
so you want to recreate just this section from your original picture?
No description
Jochem
Jochem•7mo ago
what issue are you having doing that?
roger
rogerOP•7mo ago
For now yes because I have done the top section but having problem in this
Jochem
Jochem•7mo ago
what problem?
roger
rogerOP•7mo ago
Jochem
Jochem•7mo ago
okay, that's just unfinished though do you want someone to finish it for you?
roger
rogerOP•7mo ago
?? Display flex on parent but the left side drop down is not taking full width and the right side ul li is responsible for this When I remove ul they both take equal width I want them to take equal width
Jochem
Jochem•7mo ago
flex isn't the best solution if you want direct control over the width of the sections, it's better to use grid with grid and grid-template-columns: repeat(2, 1fr); you'd be guaranteed they'd both always be half width
roger
rogerOP•7mo ago
I want to do that with flex if possible
Jochem
Jochem•7mo ago
why?
roger
rogerOP•7mo ago
Because I am using bootstrap for grid And I have used Chris for outer layout
Mannix
Mannix•7mo ago
flex-basis: 50% or width: 50% on children but i agree with Jochem
roger
rogerOP•7mo ago
Grd*
Jochem
Jochem•7mo ago
you can nest grid layouts
roger
rogerOP•7mo ago
But why flex is not working? I have used flex before it never does that
Jochem
Jochem•7mo ago
because flex, by design, will take the intrinsic size of its children into account
roger
rogerOP•7mo ago
Is ul li the culprit
Jochem
Jochem•7mo ago
only in that it's trying to be very wide compared to the dropdown
Mannix
Mannix•7mo ago
flex makes childreen as small as possible
roger
rogerOP•7mo ago
Ik but the both are children it must apply on both then Why it is acting on one side
Mannix
Mannix•7mo ago
what? i don't follow
Jochem
Jochem•7mo ago
it's looking at what size both elements would be if they weren't in a flex container, and then distributing the size available between them read up on flex sizing https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout
roger
rogerOP•7mo ago
Grid is not working
roger
rogerOP•7mo ago
No description
Jochem
Jochem•7mo ago
looks to me like both are taking half the screen?
roger
rogerOP•7mo ago
Drop down still not having similar width
Jochem
Jochem•7mo ago
you mean the input field?
roger
rogerOP•7mo ago
Yes
Mannix
Mannix•7mo ago
give a width of 100%?
roger
rogerOP•7mo ago
It is 100%
Mannix
Mannix•7mo ago
no it's not
roger
rogerOP•7mo ago
I will show you just a sec
Mannix
Mannix•7mo ago
https://codepen.io/MannixMD/pen/gOyVmLB input element has a default min-width it won't magically grow if you don't tell it to
Jochem
Jochem•7mo ago
Yup, exactly. Flex only controls the size of elements that are direct children, it doesn't change the size of grandchildren unless those are dependent on the width of their parent(s). Your flex child is .dropdown, the input inside will just have its normal, default width setting width: 100% on the input will make it grow to the width of its parent
roger
rogerOP•7mo ago
Yes yes Gotcha I was using bootstrap that is why the input field css was not active as I didn’t link the bootstrap in the codepen It’s working fine now Thankyou guys
Mannix
Mannix•7mo ago
just fyi you can add bootstrap etc when you click the cog icon. I just did it in my pen 🙂
roger
rogerOP•7mo ago
Okay thanks Now I will have to move on next section
Want results from more Discord servers?
Add your server