0

I have a fieldset with an <a> tag as child. When I resize the child the fieldset's width changes as well even if I set a width property. However, the height doesn't change. I would like to know how to set a fixed width.

fieldset {
        float: right;
        margin-top: 40px;
        display: inline-block;
        vertical-align: top;
        height: 80px;
        width: 70px;
        text-align: center;
        overflow: hidden;
        border: 1px solid rgb(226, 226, 226);
        box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 5px 0px, rgba(0, 0, 0, 0.15) 0px 4px 15px 0px;
}


a {
      background-color: red;
      border-color: rgb(212, 214, 216);
      border-width: 20px;
      box-shadow: rgb(212, 214, 216) 0.5px 0.5px 1px 0px;
      width: 50px;
}

.fa {
    padding: 5px;
    font-size: 15px;
    text-decoration: none;
    text-align: center;
    margin-left: 2px;
    transition: 0.3s;
    background: white;
    color: #303030;
    border: 10px solid red;
    border-radius: 5px;
    box-shadow: 0.5px 0.5px 0.5px 0px #d4d6d8;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<fieldset>
    <legend>Preview</legend>
    <a class="Preview"></a> 
</fieldset>
Inception
  • 57
  • 1
  • 8

1 Answers1

0

I found a solution.

Basically, I put the <a> into a <div> and I give the <div> a height and a width which is the same as the fieldset, then the size of the fieldset doesn't increase if I change the size of whatever is into the <div>

Inception
  • 57
  • 1
  • 8