I'm struggling to find the right keywords to solve this.
Here is my code that works:
HTML
<div class="windowTopBar">
<span style="display: inline-block;"><b>System Properties</b></span>
<span style="float: right;">[?][X]</span>
</div>
CSS
.windowTopBar {
background: linear-gradient(90deg, #000080, #1084D0);
color: white;
height: 2em;
min-height: 2em;
align-items: center;
margin: 0;
}
This works and floats the "System Properties" to the left and the "what will be two img buttons" to the right.
If I put the span styles into classes, it stops working. Why?
If I put "display: flex;" into the parent div, it also stops working? Why? I really want to use display flex. I've been messing with this for quite a long time actually.
My favourite solution so far, was to do display: flex and justify-content: flex-end on the parent (while using two child divs instead of spans), but I couldn't figure out how to float the "System Properties" over to the left side.
I am trying to make it responsive, so I would appreciate if someone could help me understand what the bestpractice is and defintely help me understand why span style property works in html but not as a css class.
To be extra clear, if i do:
HTML
<span class="test1">blah1</span>
<span class="test1">blah2</span>
CSS
.test1 {
display: inline-block;
}
.test2 {
float: right;
}
It doesnt work. Help please! :) Forgive me if I'm asking too much. This is my first ever question, but I've been lurking for years.