<!doctype html><style>
* { border: 1px solid black; }
.box {
background: orange;
min-width: fit-content;
width: 10px;
}
.box2 {
background: pink;
max-width: fit-content;
width: 1000px;
}
</style><div class="box">Well hello friends</div><div class="box2">Well hello friends</div>