1

Im using a multi column div. Please see CSS below:

<div id="content">
    Super duper long text....
</div>

#content {
    -webkit-column-width: 300px!IMPORTANT; 
    -moz-column-width: 300px!IMPORTANT;
    column-width: 300px!IMPORTANT;
}

It works just fine. All of my columns are 300px. Is there any way to make the first column 500px using css?

Eddie
  • 26,593
  • 6
  • 36
  • 58
  • It seems to be not possible: https://stackoverflow.com/questions/2453522/is-there-a-way-to-specify-different-widths-for-columns-in-css3 – Takit Isy May 09 '18 at 12:22

2 Answers2

1

You can use flex for it

Below is example : You can play with below properties

.header,
.footer  { flex: 1 100%; }
.sidebar { flex: 1; } /* You can change property*/
.main    { flex: 2; }

.flex-container {
  padding: 0;
  margin: 0;
  list-style: none;
  height: 200px;
  
  -ms-box-orient: horizontal;
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -moz-flex;
  display: -webkit-flex;
  display: flex;
  
  -webkit-justify-content: space-around;
  justify-content: space-around;
  -webkit-flex-flow: row wrap;
  flex-flow: row wrap;
  -webkit-align-items: stretch;
  align-items: stretch;
}

.header,
.footer  { flex: 1 100%; }
.sidebar { flex: 1; }
.main    { flex: 2; }

.flex-item {
  
  background: tomato;
  padding: 10px;
  width: 100px;
  border: 3px solid rgba(0,0,0,.2);
  
  color: white;
  font-weight: bold;
  font-size: 2em;
  text-align: center;
}
<ul class="flex-container">
  <li class="flex-item header">Header</li>
  <li class="flex-item sidebar">Sidebar</li>
  <li class="flex-item main">Main</li>
  <li class="flex-item sidebar">Sidebar</li>
  <li class="flex-item footer">Footer</li>
</ul>
LKG
  • 4,152
  • 1
  • 11
  • 21
1

To make first column wide use this code :

=> CSS

    .div_style:first-child
{
    border:1px solid black;
    width: 500px;
}
.div_style
{
    border:1px solid black;
    width: 300px;
}

=> HTML

 <div id="content_first" class="div_style">
    Super duper long text....
</div>
<div id="content" class="div_style" >
    Super duper long text....
</div>
<div id="content" class="div_style" >
    Super duper long text....
</div>