Skip to content

Instantly share code, notes, and snippets.

@psenger
Created August 25, 2023 03:49
Show Gist options
  • Select an option

  • Save psenger/3b153dad847aa729d73f148d0c294e0b to your computer and use it in GitHub Desktop.

Select an option

Save psenger/3b153dad847aa729d73f148d0c294e0b to your computer and use it in GitHub Desktop.
[HTML CSS Row Cells with Nice Borders] #HTML #CSS

HTML CSS Row Cells with Nice Borders

I want a row of cells, with nice borders. this kind of works, needs a little more work

<div class="container">
  <div class="cell">Cell 1</div>
  <div class="cell">Cell 2</div>
  <div class="cell">Cell 3</div>
  <!-- Add more cells as needed -->
</div>
.container {
  display: inline-block;
  border-collapse: collapse;
  border: none;
  padding: 0;
}

.cell {
  display: inline-block;
  width: 100px;
  height: 100px;
  margin: 0;
  text-align: center;
  vertical-align: middle;
  
  border-top-width: 2px;
  border-top-style: solid;
  border-top-color: black;
 
  border-bottom-width: 2px;
  border-bottom-style: solid;
  border-bottom-color: black;
  
  border-right-width: 2px;
  border-right-style: solid;
  border-right-color: black;

}

.cell:first-child {
  border-left-width: 2px;
  border-left-style: solid;
  border-left-color: black;
}
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment