Last active
August 29, 2015 14:04
-
-
Save jhanstra/86501c361c7020c9b38d to your computer and use it in GitHub Desktop.
HTML and CSS for empty search results to be more helpful to users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML: | |
<div class="portlet-content"> | |
<h2 class="center">No search results.</h2> | |
<div class="button-group-empty"> | |
<div class="button-div"> | |
<button class="btn btn-primary" id="btn-left">Browse all apps</button> | |
</div> | |
<div id="between-buttons"> | |
<p class="center">or</p> | |
</div> | |
<div class="button-div"> | |
<input type="search" placeholder="Search again" class="no-search-input btn-right"></input> | |
</div> | |
<p class="center feedback"><a href="#">Submit feedback about search results</a></p> | |
</div> | |
</div> | |
CSS: | |
.feedback { | |
margin-top:0px; | |
} | |
#between-buttons { | |
width:1%; | |
display:inline-block; | |
vertical-align:middle; | |
} | |
#between-buttons p { | |
position:relative; | |
top:-25px; | |
} | |
.no-search-input { | |
width:180px; | |
display:block; | |
background-color:#F7F5E8; | |
border-radius:4px; | |
border:1px solid #b70101; | |
margin-top:-7px; | |
margin-bottom:5px; | |
position:relative; | |
top:-24px; | |
left:10px; | |
font-size:1.6em; | |
color:#b70101; | |
padding:12px 8px 12px 10px; | |
} | |
.no-search-input[placeholder="Search again"] { | |
color:#b70101; | |
} | |
.no-search-input:focus { | |
outline:none; | |
} | |
.no-search-input::-webkit-input-placeholder { | |
color: #b70101; | |
font-size:0.8em; | |
line-height:1.8em; | |
} | |
.no-search-input:-moz-placeholder { /* Firefox 18- */ | |
color: #660000; | |
font-size:1em; | |
} | |
.no-search-input::-moz-placeholder { /* Firefox 19+ */ | |
color:#660000; | |
font-size:1em; | |
} | |
.no-search-input:-ms-input-placeholder { | |
color: #660000; | |
font-size:1em; | |
} | |
.portlet-content div { | |
width:100%; | |
} | |
.button-group-empty { | |
width:100%; | |
margin:30px auto; | |
display:block; | |
} | |
.portlet-content .button-div, .button-div { | |
width:48.5%; | |
display:inline-block; | |
} | |
.button-group-empty .btn-primary { | |
display:inline; | |
float:none; | |
padding:15px 30px; | |
font-size:1.3em; | |
font-weight:200; | |
} | |
#floating-div #btn-left, .portlet-content #btn-left { | |
float:right; | |
} | |
#floating-div #btn-right, .portlet-content #btn-right { | |
float:left; | |
} | |
.center { | |
text-align:center; | |
} | |
.portlet-content .button-group { | |
display:inline-block; | |
width:100%; | |
margin:0px 0px -7px -8px; | |
} | |
.portlet-content .btn { | |
float:right; | |
border:1px solid #660000; | |
background-color:#F7F5E8; | |
color:#660000; | |
margin:4px; | |
} | |
.portlet-content .btn-default:hover { | |
color:#F7F5E8; | |
background-color:#660000; | |
border:1px solid #660000; | |
} | |
.portlet-content .btn-primary { | |
background-color:#F7F5E8; | |
color:#b70101; | |
border:1px solid #b70101; | |
} | |
.portlet-content .btn:focus { | |
outline:none; | |
} | |
.portlet-content .btn-primary:hover { | |
background-color:#b70101; | |
border:1px solid #b70101; | |
color:#F7F5E8; | |
} | |
.portlet-content h2 { | |
color:#b70101; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment