-2

I have applied flex to this nav, still not able to align the items in a row, tried changing the flex-direction to row as well. Still the elements in the nav bar come up in a column format, this is not what I want, Can someone please help how to get it resolved?

[enter image description here](https://i.stack.imgur.com/zyewu.jpg)

Getting this outputoutput

  • 3
    Welcome to Stack Overflow! Relevant code and error messages need to be included in your question *as text*, [not as pictures of text](https://meta.stackoverflow.com/q/285551/328193). Just linking to screen shots makes it more difficult for people to help you. To learn more about this community and how we can help you, please start with the [tour] and read [ask] and its linked resources. – David Apr 19 '23 at 20:02
  • 1
    Does this answer your question? [How to make a
      display in a horizontal row](https://stackoverflow.com/q/885691/328193)
    – David Apr 19 '23 at 20:04

2 Answers2

1

instead of:

nav {
    display: flex;
}

try:

nav ul {
    display: flex;
}
0

The "flex" property should be put on the parent element of all the child elements to activate. In your code, it seems you put flex on nav which has only one element, "ul" so it doesn't show out put that you wanted.

For displaying the list item in flex you should put flex on the "ul"

so your code will be -

ul{
    display: flex;
}