Remove (inner-box-shadow - Edited) on Bootstrap Button Click - css

I have a bootstrap button for a standard bootstrap dropdown. I am styling it a lot to basically remove any color and make it transparent at all times. But when I click it, it has a grey inner shadow. I would like to remove it.
Here is my CSS:
.input-control {
height: 5rem;
width: 49%;
display: inline-flex;
background-color: transparent;
border-top-style: none;
border-right-style: none;
border-bottom: 1px solid dimgray;
border-left-style: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
border-radius: 0;
}
button.input-control:hover {
background-color: none;
background: none;
}
.btn-primary.active, .btn-primary:active, .open>.dropdown-toggle.btn-primary {
/* color: #fff; */
background-color: transparent;
border-color: transparent;
}
.btn:focus,.btn:active {
outline: none !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
color: #fff;
background-color: transparent;
border-color: dimgray;
}
.btn-primary.active.focus, .btn-primary.active:focus, .btn-primary.active:hover, .btn-primary:active.focus, .btn-primary:active:focus, .btn-primary:active:hover, .open>.dropdown-toggle.btn-primary.focus, .open>.dropdown-toggle.btn-primary:focus, .open>.dropdown-toggle.btn-primary:hover {
color: #fff;
background-color: transparent;
border-color: dimgray;
}
.btn-primary:hover {
color: #fff;
background-color: transparent;
border-color: dimgray;
}
dropdown > button {
background:none;
border:none;
box-shadow:none;
}
.form-background {
background: rgba(149, 246, 102, .5);
}
#find-vegan-products-page {
margin-top: 100px; /*separate the div from top of the page*/
padding: 100px; /*or whatever value to give the div space */
}
HTML:
<div id="find-vegan-products-page" style="height:900px;">
<div class="form-background">
<form role="form" style="padding: 40px;">
<div class="form-group">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle input-control no-box-shadow" type="button" data-toggle="dropdown">Dropdown Example
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control input-control no-box-shadow" placeholder="City">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
Example of the look of the dropdown:
How do I make the inner shadow go away?
EDIT: It looks a bit like an inner box-shadow that is showing in grey so the blue outline has probably fully gone away and now I need to remove the grey inner box shadow.

The answer was not too hard once I figured out it was not the blue outline staying anymore and it was now a grey box shadow.
I just had to add: box-shadow: none; to:
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
color: #fff;
background-color: transparent;
border-color: dimgray;
box-shadow: none;
}

Try this CSS code:
CSS
:focus {
outline: 0 !important;
}
Now you will never see it again. However, it is maybe not a good idea to remove it entirely.. Users who access your site and using their keyboard to 'walk' through your site never see where they are going. See this blog.

.btn.btn-default:focus {
border:none;
outline:0;
}

Related

custom-toggler in Bootstrap 4. Can't change the background color nor the border color

Sorry folks, I'm such a novice. Bootstrap 4 in Dreamweaver.
Through trial an error, and some help on here, I have managed to fix most of my problems.
Now, for the custom toggler. I found where I can change the color. But it seems only some of the color.
I got the lines yellow, but I can't make the border yellow, nor can I make the button background #0A0A0A.
It looks to me as though I have followed the guidelines I found, but maybe some of my trial and error fouled things up? screenshot of little hamburger with yellow lines, blue border and white background
Here is the CSS I used:
.custom-toggler .navbar-toggler-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(243,203,4,1)' stroke-width='3' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
//change toggler color
.custom-toggler.navbar-toggler {
border-color: #ffcc00;
}
//end change toggler color but I need to change the toggler bg color
.navbar-toggler {
padding: 0.25rem 0.75rem;
font-size: 1.25rem;
line-height: 1;
background-color: transparent;
border: 1px solid transparent;
border-radius: 0.25rem;
}
.navbar-toggler:hover, .navbar-toggler:focus {
text-decoration: none;
}
.navbar-toggler-icon {
display: inline-block;
width: 1.5em;
height: 1.5em;
vertical-align: middle;
content: "";
background: no-repeat center center;
background-size: 100% 100%;
}
Here is the HTML
</head>
<body>
<div class="container align-content-center"><img src="images/banner7.png" alt="" width="100%" lass="img-fluid"/></div>
<div class="container-fluid">
<div class="container">
<nav class="navbar navbar-expand-sm bg-custom navbar-custom">
<button class="navbar-toggler ml-auto custom-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent1" aria-controls="navbarSupportedContent1" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
<div class="collapse navbar-collapse" id="navbarSupportedContent1">
<ul class="nav justify-content-center">
<li class="nav-item active"> <a class="nav-link" href="#">Home<span class="sr-only">(current)</span></a> </li>
Do I need to duplicate and tweek all the instances for nav-light and/or nav-dark to make a complete nav-custom set?
I swear I'll go study more on W3 schools, but I'm really anxious to get this site up soon so I can make a better impression in my job search.
Thanks,
Clare
Overall, you only have to add two custom classes to your button to change the toggler SVG styling:
.custom-toggler .navbar-toggler {
color: rgba(255, 255, 255, 0.5);
border-color: #f3cb06;
background-color: #0A0A0A;
}
.custom-toggler .navbar-toggler-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(243,203,6,1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
Don't forget to add the custom class to your html:
i.e.
<nav class="navbar navbar-expand-lg custom-toggler" style="background-color: rgb(0, 0, 0);">
If you'd also like to change the button outline, modify the button:focus class.
example 1.
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
outline: revert;
}
or
example 2
button:focus {
border: 1px solid black;
outline-style:ridge;
outline-color: grey;
}
―
Add border-radius: 0.25rem; to .navbar-toggler to get those rounded corners back.
.navbar-toggler {
  padding: 0.25rem 0.75rem;
  font-size: 1.25rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}
To get rid of the white outline replace .button:focus with the example 2:
button:focus {
  outline: 1px dotted;
  outline: 5px auto -webkit-focus-ring-color;  
  outline: revert;
}

Why styling is not applying to my elements?

I have an angular app in which i have my nested dropdown menu. And in one of the list item i have primeng Tabview in that list item like this
<li *ngIf="user.role !== 'super'" class="nav-item flex-center-center flex-column min-width-40 no-border custom-bell-padding notifications-dropdown">
<a class="nav-link" id="notificationsDropDown" role="button" data-toggle="dropdown" aria-haspopup="true">
<i class="fal fa-bell font-26"></i>
</a>
<div class="dropdown-menu" aria-labelledby="notificationsDropDown" (click)="onClick($event)">
<span class="dropdown-menu-arrow"></span>
<div class="ui-g header-dropdown-list">
<div class="ui-g-12 list-item-border-bottom">
<div class="ui-g-6">
<p class="font-11 pb-0">Your Notifications</p>
</div>
<div class="ui-g-6 font-11 text-right">
<app-checkbox [disabled]="disabled" label="Technician updates" [isChecked]="true"></app-checkbox>
</div>
</div>
<div class="ui-g-12">
<p-tabView class="tab-panel-underline">
<p-tabPanel header="All">
<ng-template pTemplate="content">
</ng-template>
</p-tabPanel>
<p-tabPanel header="Critical">
<ng-template pTemplate="content">
</ng-template>
</p-tabPanel>
</p-tabView>
</div>
</div>
</div>
Now i am applying custom styling in component.scss like this
.notifications-dropdown{
.dropdown-menu {
left: 843px !important;
margin: -0.875rem 0 0;
font-size: 0.875rem;
color: #7A8281;
text-align: left;
list-style: none;
border: 0 solid #c8ced3;
box-shadow: 0px 3px 6px #00000029;
z-index: 99999;
top: 74px;
border-radius: 0px;
width: 20rem;
/* min-width: 18.2rem; */
/* right: 0px; */
.header-dropdown-list{
// height: 150px;
.list-item-border-bottom{
border-bottom: 1px solid #e5e6e6;
}
p-tabview.tab-panel-underline {
.ui-tabview{
padding: 20px !important;
.ui-tabview-nav li{
width: 50% !important;
padding: 0px !important;
}
}
}
}
}
But my styling is not applying on primeng tabview. I have this tabview inside of my main list item i.e li and applying some padding and width of li of primeng tabview but it's not applying my custom styles.
I have fixed this issue. The problem was causing due to ViewEncapsulation. My problem solved when i put ViewEncapsulation.None inside my component.
You can use ng-deep and & opertor in scss which refrence to parent class.
::ng-deep .notifications-dropdown{
.dropdown-menu {
left: 843px !important;
margin: -0.875rem 0 0;
font-size: 0.875rem;
color: #7A8281;
text-align: left;
list-style: none;
border: 0 solid #c8ced3;
box-shadow: 0px 3px 6px #00000029;
z-index: 99999;
top: 74px;
border-radius: 0px;
width: 20rem;
/* min-width: 18.2rem; */
/* right: 0px; */
.header-dropdown-list{
// height: 150px;
& .list-item-border-bottom{
border-bottom: 1px solid #e5e6e6;
}
& p-tabview.tab-panel-underline {
& .ui-tabview{
padding: 20px !important;
& .ui-tabview-nav li{
width: 50% !important;
padding: 0px !important;
}
}
}
}
}

CSS borders issue on MS Edge

I am trying to implement this:
https://www.w3schools.com/howto/howto_js_tabs.asp
except with additional borders.
When I select Tokyo, or mouse out of Paris, the menu button side borders disappear using MS Edge. It works perfectly in Chrome and Firefox.
Here's my code:
<!DOCTYPE html>
<html>
<!-- Tabs by Aubrey Bourke 2019 -->
<head>
<style>
body{
font-family: Sans-serif;
background-color: white;
}
/* Style the tab */
.tab {
overflow: hidden;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
background-color: #f1f1f1;
}
/* Style the buttons inside the tab */
.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 16px 16px;
transition: 0.3s;
font-size: 17px;
}
/* Change background color of buttons on hover */
.tab button:hover {
/*background-color: #ddd;*/
}
/* Create an active/current tablink class */
.tab button.active {
background-color: white;
}
/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
border: 1px solid #ccc;
border-top: none;
background-color: white;
}
.container{
box-shadow: 2px 2px 1px 0px #eee;
width: 500px;
}
#blank{
background-color:#efefef;
cursor: default;
}
#one{
background-color:white;
}
</style>
</head>
<body onload="openCity(event, 'London')">
<div class="container">
<div class="tab">
<button id="one" class="tablinks" onclick="openCity(event, 'London')">London</button>
<button id="two" class="tablinks" onclick="openCity(event, 'Paris')">Paris</button>
<button id="three" class="tablinks" onclick="openCity(event, 'Tokyo')">Tokyo</button>
<button id="blank" class="tablinks" style="width:255px; border-bottom: 1px solid #ccc;"> </button>
</div>
<div id="London" class="tabcontent">
<h3>London</h3>
<p>London is the capital city of England.</p>
</div>
<div id="Paris" class="tabcontent">
<h3>Paris</h3>
<p>Paris is the capital of France.</p>
</div>
<div id="Tokyo" class="tabcontent">
<h3>Tokyo</h3>
<p>Tokyo is the capital of Japan.</p>
</div>
</div>
<script>
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
if(cityName=="London"){
<!-- One -->
document.getElementById("one").style.backgroundColor="white";
document.getElementById("one").style.borderRight="1px solid #ccc";
document.getElementById("one").style.borderBottom="1px solid white";
<!-- Two -->
document.getElementById("two").style.borderLeft="0px solid #ccc";
document.getElementById("two").style.borderRight="0px solid #ccc";
document.getElementById("two").style.borderBottom="1px solid #ccc";
<!-- Three -->
document.getElementById("three").style.borderLeft="1px solid #efefef";
document.getElementById("three").style.borderRight="1px solid #efefef";
document.getElementById("three").style.borderBottom="1px solid #ccc";
}
if(cityName=="Paris"){
<!-- One -->
document.getElementById("one").style.backgroundColor="#f1f1f1";
document.getElementById("one").style.borderRight="1px solid #ccc";
document.getElementById("one").style.borderBottom="1px solid #ccc";
<!-- Two -->
document.getElementById("two").style.borderLeft="1px solid #efefef";
document.getElementById("two").style.borderRight="1px solid #ccc";
document.getElementById("two").style.borderBottom="1px solid white";
<!-- Three -->
document.getElementById("three").style.borderLeft="1px solid #efefef";
document.getElementById("three").style.borderRight="1px solid #efefef";
document.getElementById("three").style.borderBottom="1px solid #ccc";
}
if(cityName=="Tokyo"){
<!-- One -->
document.getElementById("one").style.backgroundColor="#f1f1f1";
document.getElementById("one").style.borderRight="1px solid #efefef";
document.getElementById("one").style.borderBottom="1px solid #ccc";
<!-- Two -->
document.getElementById("two").style.borderLeft="1px solid #efefef";
document.getElementById("two").style.borderRight="1px solid #ccc";
document.getElementById("two").style.borderBottom="1px solid #ccc";
<!-- Three -->
document.getElementById("three").style.borderLeft="1px solid #efefef";
document.getElementById("three").style.borderRight="1px solid #ccc";
document.getElementById("three").style.borderBottom="1px solid white";
}
}
</script>
</body>
</html>
Can anyone tell me why the borders disappear after hovering over them in MS Edge? Is there any way to fix this?
Well, not quite an answer to your question, but rather a different approach that works in classic Edge and other modern browsers.
I think there are better strategies for marking up and styling these tabs, but I stuck generally with the markup you provided. May not be at all what you're looking for, but perhaps it may be somewhat helpful in thinking through the relevant issues (e.g., extracting styling from JS, etc.).
I've leaned on CSS to do the heavy lifting with regard to styling and tried to simplify the JavaScript so that it does what it does well. I typically shy far away from adding styles to elements via JS unless I have a specific use case that constrains me to do so. That's generally good practice, but perhaps you have reasons I don't know for doing it like you did.
Best of luck.
function openCity(evt, cityName) {
var i, tabcontent;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
document.getElementById(cityName).style.display = "block";
var toggleTabs = function (e) {
var active = document.querySelector('.active');
if (active) {
active.classList.remove('active');
}
e.currentTarget.classList.add('active');
}
var tablinks = document.querySelectorAll(".tablinks");
var tablinksSet = Array.from(tablinks);
tablinksSet.forEach(function (item) {
item.addEventListener('click', function (e) {
toggleTabs(e);
})
})
}
body {
font-family: Sans-serif;
background-color: white;
}
/* Style the tab */
.tab {
position: relative;
border-style: solid;
border-width: 1px;
border-color: #ccc #ccc transparent #ccc;
background-color: #f1f1f1;
}
/* Style the buttons inside the tab */
.tab button {
background-color: inherit;
float: left;
margin-top: -1px;
border: 1px solid transparent;
outline: none;
cursor: pointer;
padding: 16px 16px;
transition: 0.3s;
font-size: 17px;
border-bottom: 1px solid #f1f1f1;
border-top: 1px solid #ccc;
}
/* Change background color of buttons on hover */
.tab button:hover {
/*background-color: #ddd;*/
}
/* Create an active/current tablink class */
.tab button.active {
position: relative;
background-color: white;
border: 1px solid #ccc;
border-bottom-color: white;
}
.tab button.active::after {
content: "";
position: absolute;
display: block;
width: 100%;
height: 2px;
bottom: -2px;
left: 0;
background-color: white;
z-index: 50;
}
.tab button:first-child {
margin-left: -1px;
}
.tab button:not(.active):first-child {
border-left-color: #ccc;
}
.tabcontents {
width: 500px;
float: left;
}
/* Style the tab content */
.tabcontent {
position: relative;
z-index: 1;
display: none;
padding: 6px 12px;
margin-top: -1px;
background-color: white;
border-style: solid;
border-width: 1px;
border-color: #ccc #ccc #ccc #ccc;
}
.cf:before,
.cf:after {
content: " ";
display: table;
}
.cf:after {
clear: both;
}
.container {
width: 500px;
}
<!DOCTYPE html>
<html>
<head></head>
<body onload="openCity(event, 'London')">
<div class="container">
<div class="tab cf">
<button id="one" class="tablinks active" onclick="openCity(event, 'London')">London</button>
<button id="two" class="tablinks" onclick="openCity(event, 'Paris')">Paris</button>
<button id="three" class="tablinks" onclick="openCity(event, 'Tokyo')">Tokyo</button>
</div>
<div class="tabcontents">
<div id="London" class="tabcontent">
<h3>London</h3>
<p>London is the capital city of England.</p>
</div>
<div id="Paris" class="tabcontent">
<h3>Paris</h3>
<p>Paris is the capital of France.</p>
</div>
<div id="Tokyo" class="tabcontent">
<h3>Tokyo</h3>
<p>Tokyo is the capital of Japan.</p>
</div>
</div>
</div>
</body>
</html>

Bootstrap dropdown is not full width

My bootstrap dropdown for some reason is nowhere near full width and I need it to be.
Here is an image of what Im talking about:
The country and city are bootstrap dropdowns which I have styled rather a lot to completely change the look. They are each inside a container row. They each take up 6 columns so that it is split in half. I just want them to take up their full half of the green bit. Here is my code.
HTML:
<div id="find-vegan-products-page" style="height:900px;">
<div class="form-background">
<div class="container-fluid" style="padding: 40px;">
<h1>Filter Your Search!</h1>
<form role="form">
<div class="row">
<div class="form-group col-sm-6">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle input-control no-box-shadow" type="button" data-toggle="dropdown">Country
</button>
<ul class="dropdown-menu">
<li>HTML
</li>
<li>CSS
</li>
<li>JavaScript
</li>
</ul>
</div>
</div>
<div class="form-group col-sm-6">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle input-control no-box-shadow" type="button" data-toggle="dropdown">City
</button>
<ul class="dropdown-menu">
<li>HTML
</li>
<li>CSS
</li>
<li>JavaScript
</li>
</ul>
</div>
</div>
</div>
</form>
</div>
</div>
CSS:
.input-control {
height: 5rem;
background-color: transparent;
border-top-style: none;
border-right-style: none;
border-bottom: 1px solid dimgray;
border-left-style: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
border-radius: 0;
}
button.input-control:hover {
background-color: none;
background: none;
}
.btn-primary.active,
.btn-primary:active,
.open>.dropdown-toggle.btn-primary {
/* color: #fff; */
background-color: transparent;
border-color: transparent;
}
.btn:focus,
.btn:active {
outline: none !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
color: #fff;
background-color: transparent;
border-color: dimgray;
box-shadow: none;
}
.btn-primary.active.focus, .btn-primary.active:focus, .btn-primary.active:hover, .btn-primary:active.focus, .btn-primary:active:focus, .btn-primary:active:hover, .open>.dropdown-toggle.btn-primary.focus, .open>.dropdown-toggle.btn-primary:focus, .open>.dropdown-toggle.btn-primary:hover {
color: #fff;
background-color: transparent;
border-color: dimgray;
}
.btn {
font-weight: 100;
}
.btn-primary:hover {
color: #fff;
background-color: transparent;
border-color: dimgray;
}
dropdown > button {
background:none;
border:none;
box-shadow:none;
}
.form-background {
background: rgba(149, 246, 102, .5);
}
#find-vegan-products-page {
margin-top: 100px; /*separate the div from top of the page*/
padding: 100px; /*or whatever value to give the div space */
}
.btn.btn-default:focus {
border:none;
outline:0;
}
.form-control::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color: white;
font-weight: 100;
}
.form-control:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: white;
opacity: 1;
font-weight: 100;
}
.form-control::-moz-placeholder { /* Mozilla Firefox 19+ */
color: white;
opacity: 1;
font-weight: 100;
}
.form-control:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: white;
font-weight: 100;
}
.form-control:placeholder-shown { /* Standard (https://drafts.csswg.org/selectors-4/#placeholder) */
color: white;
font-weight: 100;
}
How do I make the bootstrap dropdowns take up their full 6 columns in the bootstrap container? The only thing that will look different will be the bottom border will go the full width of the 6 container columns.
I did the following:
.input-control {
border:none; /* Remove border bottom */
}
.dropdown, .dropup {
border-bottom: 1px solid #696969; /* Add bottom border to drop down instead */
}
.dropdown-menu {
width:100%; /* Make drop down 100% width OPTIONAL */
}
I put an optional 100% width on the drop down menu incase you wanted the border to match.
UPDATE:
Having the button full width would help usability as well.
.input-control {
width:100%;
text-align:left;
}

html issue ,a div positioning problem

I have implemented a facebook style search suggestion feature for my application . But , I am facing some issues here .
i) Below is the search box and the result div code :
<div align="right" style=" width:300px; float:right; margin-right:30px">
<input type="text" id="searchbox" class="searchbox" maxlength="100" style="color: rgb(170, 170, 170);"> <img src="../../../asset/images/search.png" style="margin:0 0 -5px 2px"><br><br>
<input type="hidden" value="http://www.plus-one-me.com/search/google/interests" id="formurl" name="formUrl">
<div id="display">
</div>
</div>
The search results get displayed within the #display div as below:
<div id="display" style="display: block;">
<div class="display_box" align="left"> Cakephp </div>
<div class="display_box" align="left"> Myspace </div>
<div class="display_box" align="left"> Php </div>
</div>
This is how the page looks before we enter anything in the search area :
Below is what the search results div is doing :
Basically , it brings down the menu in my main content area . So how can I fix this using CSS ?
Below are the styles :
of the menu div in the background (containing the options Home,History and Settings
.menuBar .submenu {
padding:4px 12px 5px 12px;
margin-right:8px;
border:2px solid #EEE;
text-decoration:none;
display:inline-block;
float:left;
font-size:13px;
-moz-border-radius:40px;
border-radius:40px;
-webkit-border-radius:40px;
-moz-box-shadow:0 1px 3px #777;
-webkit-box-shadow:0 2px 3px #777;
box-shadow:0 2px 3px #777;
color:#333;
background: -webkit-gradient(linear, 0 0, 0 70%, from(#765), to(#FFF));
background: -webkit-linear-gradient(#000, #FFF 70%);
background: -moz-linear-gradient(#BBB, #FFF 100%);
background: -ms-linear-gradient(#765, #FFF 70%);
background: -o-linear-gradient(#765, #FFF 1000%);
background: linear-gradient(#765, #FFF 70%);
-pie-background: linear-gradient(#765, #FFF 70%);
}
of my searchbox :
#searchbox {
border: 1px solid #000000;
padding: 3px;
width: 250px;
}
and the display_box for individual results :
.display_box {
border-top: 1px solid #DEDEDE;
font-size: 12px;
height: 30px;
padding: 4px;
}
the drop down menu has to have position:absolute applied to it. This takes it out of the flow of the page so it doesn't affect other elements.
As #Galen suggested, try css:
#display {
position: absolute;
}
You might want to instead have the html thats outputed be something more like
<ul id="display">
<li>result</li>
<li>result</li>
<li>result</li>
</ul>
Which if you did, you would have css along the lines of
#display {
position: absolute;
list-style-type: none; list-style: none;
margin: 0; padding: 0;
}
#display li {
display: block;
border-top: 1px solid #DEDEDE;
font-size: 12px;
height: 30px;
padding: 4px;
}

Resources