LeonLatex Posted August 20, 2022 Share Posted August 20, 2022 As an example: /* Clear floats after the columns */ .row:after { content: ""; display: table; clear: both; } .column { float: left; width: 33.33%; } <div class="row"> <div class="column"></div> <div class="column"></div> <div class="column"></div> </div> Does it matter if it says row or something else in front of :cleare ? Can row be replaced with something else? That is, e.g. background or something else? As I have understood it from what I have read online, :cleare can NOT be replaced with something else, understandably according to the function. Quote Link to comment https://forums.phpfreaks.com/topic/315213-cleare-table/ Share on other sites More sharing options...
requinix Posted August 20, 2022 Share Posted August 20, 2022 If you're making your own grid layout then stop doing that and use the existing grid layout instead. https://developer.mozilla.org/en-US/docs/Web/CSS/grid Quote Link to comment https://forums.phpfreaks.com/topic/315213-cleare-table/#findComment-1599634 Share on other sites More sharing options...
morocco-iceberg Posted October 2, 2022 Share Posted October 2, 2022 Honestly so glad that we don't need to mess around with floats for basic layouts anymore. Grid layout is so much nicer to work with, and for almost everything else there's flexbox: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox Quote Link to comment https://forums.phpfreaks.com/topic/315213-cleare-table/#findComment-1601267 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.