{"id":23814168,"url":"https://github.com/dfkaye/simple-3-column-css","last_synced_at":"2025-08-03T00:15:42.177Z","repository":{"id":7828460,"uuid":"9199671","full_name":"dfkaye/simple-3-column-css","owner":"dfkaye","description":"CSS kata for flexible layout using classes to re-order columns in given markup","archived":false,"fork":false,"pushed_at":"2013-09-05T21:32:05.000Z","size":488,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T20:16:42.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfkaye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-03T16:42:38.000Z","updated_at":"2014-01-01T07:59:27.000Z","dependencies_parsed_at":"2022-09-21T04:41:19.846Z","dependency_job_id":null,"html_url":"https://github.com/dfkaye/simple-3-column-css","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dfkaye/simple-3-column-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfkaye%2Fsimple-3-column-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfkaye%2Fsimple-3-column-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfkaye%2Fsimple-3-column-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfkaye%2Fsimple-3-column-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfkaye","download_url":"https://codeload.github.com/dfkaye/simple-3-column-css/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfkaye%2Fsimple-3-column-css/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268477179,"owners_count":24256453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-02T03:46:41.038Z","updated_at":"2025-08-03T00:15:42.077Z","avatar_url":"https://github.com/dfkaye.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"simple-3-column-css\n===================\n\nA cross-browser flexible 3-column layout CSS plus required HTML.\n\ngoal\n----\n\nGiven one set of markup, one set of CSS, change one CSS class name in the markup to re-order the columns.\n\nexample\n-------\n\nView the \u003ca href='http://rawgithub.com/dfkaye/simple-3-column-css/master/index.html' target='_new'\u003eworking example\u003c/a\u003e\n\n+ The basic layout works fine cross-browser, back to IE6.\n+ Nesting 3-col inside another 3-col requires longer (more specific) CSS selectors to override widths, etc.\n\nkey factors\n-----------\n\n+ Solution requires float-based layouts (plus a clearfix) - makes IE6 harder because of the old \"doubled margins\n    in floated elements\" bug we used to love.\n+ Columns 1 and 2 need to be wrapped by an \"intercolumn\" element, with column 3 a sibling after that \n    (see p. 94, Brian Henick, \n        [HTML and CSS: The Good Parts](http://www.amazon.com/dp/0596157606), O'Reilly', 2010).\n+ Change only the order-{XYZ} class in the \"columns\" div.\n+ Specify actual widths of each column and intercolumn (which contains cols 1 and 2) in a separate \n    layout-specific or page-specific css file.\n\ngiven this markup:\n-----------------\n\n    \u003cdiv id=\"simple\" class=\"clearfix columns order-{XYZ}\"\u003e\n      \u003cdiv class=\"intercolumn\"\u003e\n        \u003cdiv class=\"col-1\"\u003e\n          \u003ch1\u003e1. main section\u003c/h1\u003e\n          \u003cp\u003emain paragraph\u003c/p\u003e\n        \u003c/div\u003e\n        \u003cdiv class=\"col-2\"\u003e\n          \u003ch1\u003e2. more section\u003c/h1\u003e\n          \u003cp\u003emore paragraph\u003c/p\u003e\n        \u003c/div\u003e\n      \u003c/div\u003e\n      \u003cdiv class=\"col-3\"\u003e\n        \u003ch1\u003e3. related section\u003c/h1\u003e\n        \u003cp\u003erelated paragraph\u003c/p\u003e\n      \u003c/div\u003e\n    \u003c/div\u003e\n\n\nuse this CSS to specify 3-column layout:\n---------------------------------------\n\n    .columns {\n      /* set width to contain intercolumn and .col-3 */\n    }\n    .intercolumn {\n      /* contains columns 1 and 2 */\n      /* set width to contain col-1 and .col-2 */\n      float: left;\n    }\n    .col-1 {\n      float: left;\n    }\n    .col-2 {\n      float: left;\n    }\n    .col-3 {\n      float: left;\n    }\n    .order-132 .intercolumn {\n      width: auto;  /* unset width for non-contiguous case in IE */\n      float: none;\n    }\n    .order-132 .col-2 {\n      float: right;\n    }\n    .order-213 .col-1 {\n      float: right;\n    }\n    .order-231 .intercolumn {\n      width: auto; /* unset width for non-contiguous case in IE */\n      float: none;\n    }\n    .order-231 .col-1 {\n      float: right;\n    }\n    .order-312 .intercolumn {\n      float: right;\n    }\n    .order-321 .intercolumn {\n      float: right;\n    }\n    .order-321 .col-1 {\n      float: right;\n    }\n\n      \nYou'll need this for the floated layout clearing problems:\n\n    .clearfix {\n      clear: both;\n    }\n    .clearfix:after {\n      content: \".\";\n      visibility: hidden;\n      display: block;\n      height: 0;\n      clear: both;\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfkaye%2Fsimple-3-column-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfkaye%2Fsimple-3-column-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfkaye%2Fsimple-3-column-css/lists"}