milorules1012 milorules1012 - 1 year ago 142
CSS Question

Size CSS button to HTML border

I have been making a website, and I created a few buttons. Recently I have used css "padding" to size the buttons to be equal in size to each other. What I am wondering is, is there a way that I can size the button to fit with the table border, so it can look nice in any resolution size browser?

Here is a screenshot of my site so you guys know what you're looking at

Answer Source

Give button a width:100% and the td a padding: 0

table {
  width: 200px;
td {
  border: 1px solid;
  padding: 0;
button {
  width: 100%;

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download