Can't figure out why content inside of my div is getting scrunched when the div collapses - css

Here is the link to the portfolio page I'm currently working on in react. When you collapse a div the content gets scrunched and I'm not sure what the solution to this is. I thought it was "white-space: nowrap;" but that doesn't seem to be doing anything for me. I'm sure it's something super simple but can't pinpoint what's happening.
Appreciate any help. Thank you!
https://goresometimes.netlify.app/

This happens as the width of your content drawer is 100% and the content flows dynamically to this width. You'll want to use fixed width like width: 100vw on relevant container elements instead. The actual value needs to be adjusted according to what you need*

remove height:100% on .navbox also remove in media query

Related

How to Position Fixed with LOTS elements inside

I'm working on a simple page but got into a trouble with fixed position. Wonder if anyone has the time to give me a hand.
It will be too much to copy and paste all the codes here but I will paste a link
http://et4891.com/lecture/protosite.shtml
for the header with the nav I want both being fixed which means when I'm scrolling down the page the whole header with nav will always be there. But no matter how I do it things just keep on messed up. The nav is with css dropdown and floating.
Anyone able to give me a hand? I want to fix the position only with css not jquery though.
Thanks in advance.
Throw header and nav into a div. Give that div position: fixed;. Make sure you increase margin-top for proto-main-content as this section is no longer affected by the header and nav's position.

CSS min-height 100% page with content height 100%

I have created a page that has a min-height of 100% with a footer, as outlined http://peterned.home.xs4all.nl/examples/csslayout1.html
It works for the page-filling div, but I would like to have elements inside it which also take up all the height available to them.
Attempts:
Adding height: 100% to them does not work. They will use the parent's height but there are other elements and padding etc so that's the wrong height.
Making them absolute and set top: 0px; bottom: 0px;. This will make the div fill up the entire height, but if content is added the div doesn't get higher.
If this explanation is unclear, I have an example here: http://markv.nl/stack/quine.php
So the parent dictates a minimum height, as does the content. The highest of them should be selected. I've found this a formidable challenge; is it possible without javascript?
Thanks in advance!
It is possible without javascript. But you should not use absolute positioning with this problem. Use this solution to have footer stick to the bottom of the page. And make content div min-height: 100%. With more content it expand and push the footer down and with little content footer will be at the bottom of the page and content div will be pushed up to the footer.
After a lot of fiddling, I am quite confident that what I want to do is impossible. Correct me if I'm wrong.
In my case, it turned out a fix was possible. I used the position: absolute to create the background pattern. Above that, I added the content in a width:100% div to make the page scale.
It'll only work for some applications, but I think a general solution is not possible.

Overlapping content and elastic width issues CSS

I'm sort of new at Web Design, I'm getting there, though. But I'm still having trouble with elastic layouts and floats. I think that's where my problem with this page lies but I'm too inexperienced to understand it.
Here's my problems illustrated:
https://img.skitch.com/20120327-nwrm3t1u8cwppnwnegw8f2q7st.jpg
Here's a fiddle with my code:
http://jsfiddle.net/C3Dw2/1/
This is what it SHOULD look like:
http://img.photobucket.com/albums/v410/justice4all_quiet/register_13.jpg
I also want to have the right scrolling section fit in it's parent div. Right now, it's flowing out of it.
Ugh.
Any help would be awesome.
EDIT
The only issue remaining now is the icons not staying in their parent divs.
http://jsfiddle.net/xehMG/2/
See the fiddle for code and demo:
Fiddle: http://jsfiddle.net/C3Dw2/4
Demo: http://jsfiddle.net/C3Dw2/4/embedded/result/
see screen shot for output:
Set min-height on each of the elements that u've given height and width in percentage.Percentage will be effective only when the resolution is big enf to encompass ur children elements.
If you want to use percentages - note the min-width required for their children and set that min-width for its parent.Also use overflow:hidden|scroll|auto as a fall back to control the overflow of the children out of its parent.

Fixed topbar vs named anchors

I have a topbar with position:fixed which also contains anchor links (jdjd).
The problem is that the target is placed in the top of the viewport (behind the fixed topbar).
how can I fix so the the browser scrolls so that the target is shown just below the topbar?
As far as i know there is no clean soloution. If you use inline scrollbar it can be achieved, but it needs a fixed height then.
2 soloutions found using CSS: http://css-tricks.com/hash-tag-links-padding/
Else you could pretty easy use JQUERY to measure the users height, put it into a container div, and have scrolling on that.
See: http://jsfiddle.net/jpGdu/
Another soloution could be giving the element ur linking to a padding top (if it's h1 or whatever) :)
Not sure why you're being downvoted, it seems like an honest a good question.
I'd put a margin-top on the viewport, equal to the height of the fixed topbar.
http://jsfiddle.net/justiceerolin/KfMLJ/ as an example

CSS Container Height

I have a layout that should have a sidebar on the right hand side of the content area.
The sidebar should display 100% height of its container (#content), but for an unknown reason this content area doesn't have any height, therefore the sidebar isn't appearing.
Any help is appreciated.
Thanks in advance,
Tom
Here's my code:
http://jsfiddle.net/tomperkins/G4f6u/
You are using height: 100% for all elements surrounding it, so it is inheriting the size from the html element. As it doesn't have any size specified, neither does any of the children relying on it.
Use this to make the html and body element fill the window:
html, body { height: 100%; }
I made a few changes dealing with the positioning of the sidebar - which I changed to absolute and added a min-height so that if the contents of it were empty it would still be visible.
Link
Not sure if this is what you were looking for - but it might help.
Set static height on your .content (in px) and you will see the sidebar
Here is an answer from a layman: The problem is that you've got two child <div>s which are both floated, meaning they are outside the regular flow of the document. This causes them to be excluded from the height calculations of their parent, in this case, the <div> with class "content".
You may fix this by adding a <div> after those two floats with style "clear:both" (I believe). This is not the "best" way to fix this particular problem, as it is adding non-semantic markup to your page, but it is fairly easy to understand and implement. Cheers!
Edit: see Container div ignores height of floated elements and then follow the link in the answer to read more.

Resources