Q:

Transition Not Working CSS

So I currently have some JQuery on my page which allows a user to click on a button, and In turn, it will open a search box. However, I would like my search box to slowly glide open, instead of just popping open out of now where. So I added a transition for 2 class's in my CSS, but they don't want to work.
Here is my HTML:
<form class="ngen-search-form form-search" action="search" method="get">
    <input type="text" name="q" id="search-input" class="form-search-input" placeholder="Search for games..." dir="ltr">
    <input type="text" onclick="expandSearch()" readonly="readonly" class="form-search-submit" value="&#x1f50e;">
</form>

CSS:
.form-search-input{
    width:0px;
    height:55px;
    display:none;
    border: 0;
    outline: 0;
    font-size:21px; 
    padding: 0px 0px 0px 20px;
    color: #151515;
    transition: .5s;
}
.search-input-open{
    width:410px !important;
    display: initial !important;
    transition: .5s;
}
.form-search-submit{
    width:55px;
    height:45px;
    border: 0;
    outline: 0;
    background-color:#151515;
    font-size:21px;
    color: white;
    cursor: pointer;
    text-align:center;
}

And JQuery:
function expandSearch(){
            $('#search-input').toggleClass('search-input-open');
        }

Any ideas on how it might not be working?
Thanks

A:

Try this:
.form-search-input{
    width:0px;
    height:55px;
    border: 0;
    outline: 0;
    font-size:21px; 
    padding: 0px 0px 0px 0px;
    color: #151515;
    transition: all 0.5s;
}

.form-search-submit{
    display:inline-block;
    width:55px;
    height:45px;
    border: 0;
    outline: 0;
    background-color:#151515;
    font-size:21px;
    color: white;
    cursor: pointer;
    text-align:center;
}

.search-input-open{
    width:410px;
    padding: 0px 0px 0px 20px;
}

The JSFiddle

