Forum Moderators: not2easy
so use 'float:right' and 'clear:right' on the img css.
the few sites I've seen using flexbox extensively ... yuk. For me it's distracting and annoying.
Float and flexbox--and {display: inline-block;}--are different things serving different purposes. Learn which one is appropriate, and use it.
Is it possible to completely separate form and function?
The trick is to put a div with some id around the layout you want, then you can have the basic html tags do what you want when associated with that single layout div id.
<style>
/* use css to style a tag */
h2 {
font-size:1.5em;
color: green;
}
h3{
font-size:1.25em;
color: blue;
}
/* style using class */
.my-class{
font-size:1.1em;
color: black;
}
/* style using id */
#my-id{
font-size:1em;
color: peachpuff;
}
/* Pro tip - you can combined them */
h2.my-class{
color: dodgerblue;
}
<style>
<body>
<h2>
This is simply an H2
</h2>
<h2>
This is another H2
</h2>
<h3>
This is simply an H3
</h3>
<div class="my-class">
This is a div styled with my class
</div>
<p class="my-class">
This is a p styled with my class
</p>
<p class="my-class">
This is a p another styled with my class
</p>
<div id="my-id">
This is a div styled with my class
</div>
<h2 class="my-class">
This is a third h2 but it is identified by class="my-class"
</h2>
<p class="my-class">
note the color of the h2 above is neither the same as h2 or my-class but it is specific to h2.my-class
</p>
</body>
In which case yes one can use flexbox to make things annoying.I've taken it from the other side: if someone says that suchandsuch site is a good example of flexbox, I go have a look, and that's when I say Eeuw, yuk. In practice, it’s just inline-block with more options.
“A is subordinate to B”
I go have a look, and that's when I say Eeuw, yuk.
What does this mean?a {float: right; clear: right;}
All of this is based on the assumption that you have not forced ... window width
why does it even need to be cleared explicitly, would it no have made more sense that float is simply cleared by default?I think I can count on my fingers the times I’ve had occasion to use a float without any clearing--maybe with two very small images belonging to the same text block--but generally it just looks messy. In practice the choice is between clear: one-side (whichever side the float is on) and clear: both in the rare case where there are right and left floats in the same general area.
Let just agree to disagree.Well, this whole digression did start with me saying “Personally, {blahblah}” :) With that opening, everything that follows has to be more or less a matter of opinion. I do think the real choice is not float vs. flexbox, but inline-block vs. flexbox. I’ve seen a lot of posted CSS that uses float in ways that I would consider inappropriate.