align-items: center should work just fine (with flexbox).
It may depend on the height of the elements and their container. If the height of the container is just the height of the tallest element inside the container you won’t really see the centering.
Example code
#nav {
display: flex;
align-items: center;
/* just so you can see the centering */
height: 80px;
background: #00bcd4;
}
#nav li {
display: block;
padding: 10px;
}
#logo {
max-width: 400px;
max-height: 50px;
}
#nav-right {
display: flex;
padding: 0;
margin: 0 0 0 auto;
/* just so you can see the centering */
background: #9C27B0;
}
So just to clarify, if I made a div and it had paragraphs in it and I wanted to pop the paragraphs in line like this I couldnt just make a class for the div and apply it to that, I need to specify what inside the div I want to make inline?
I thought I could make a div and do say display: flex and this sorts everything inside the div.
Its just really the example above I’m referring to, I’ve created nav bars before and used display flex to do it so just puzzled why I cant this time.
Don’t worry about that though, in stead I’ll ask… this challenge wants me to make this website with the same functionality, but the nav bar is sticky which after a quick google you need JS to do. I’ve not done any JS yet so am I missing something?
Well you can do the UL with flexbox as well if that is what you mean:
.nav-right ul{
display:flex;
list-style:none;
}
.nav-right ul li{
margin:10px;
}
As for the other thing, usually making something sticky involves using position:fixed. Not sure why JavaScript would be needed. Did any of the posts you found say why?
The post must of been nonesense then, glad to hear it!
On the same challenge I am onto creating the part with the 3 benefits, the images next to them I cannot copy though for some reason. Is this because they are done with CSS? If so do I need to create these in CSS to pass? I was hoping to never need to do this lol, seems so silly coding an image
The script just makes it toggle between being sticky and not being sticky based on how far down the page you have scrolled. Not sure if that is a requirement for the exercise.
Yeah those are actually font-awesome icons not image files. Check out https://fontawesome.com/icons?d=gallery for how to use those. You do those by adding classes to <i></i> tags. E.g.,