Wie lautet denn das Coding in CSS wenn ich in der Navbar z.B. 3 Tags links haben möchte und eins rechts?

Hallo zusammen,

also Coding Anfänger hätte ich eine Frage wie oben schon beschrieben.

Layout wäre dann wie folgt.

‘x”y”z’ Space ‘a’

Wäre nett wenn mir da kurz jemand helfen könnte, danke.

Liebe Grüße

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Babelfish
1 year ago

Without knowing your previous CSS, you can’t really help. There are so many ways to reach. I would Flexbox take and take margin-left:auto place the elements on the right:

HTML


CSS

.nav {
 display: flex;
}
.nav button {
 margin-right: .5rem;
 margin-left: .5rem;
}
.nav button.right {
 margin-left: auto;
}

Example

https://jsfiddle.net/Ln43cots/

BeamerBen
1 year ago

Could be done via a Flexbox, there is even an example in the MDN for exactly this use case:

MDN Layout Cookbook: Split navigation

You can find more in the documentation on Flexbox and Alignment:

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container#using_auto_margins_for_main_axis_alignment

FaTech
1 year ago

Make 2 containers. (Div)

One left, one right.

Then you set flexbox space between. That should go. See: https://css-tricks.com/snippets/css/a-guide-to-flexbox