Question about the problem in the shadow menu - html

The shadow of my menu has a problem and when I click on the item that open a submenu , the shadow of opened submenu has a problem and it dosen't have any effect on the right of submenu that opened for the down item in the menu, what can I do ? I am too confused, I Appreciate it if you get the code instead of the link, thanks.
The Code:
ul {
/* border: 1px solid #555;*/
position:relative;
font-family: 'Roboto', sans-serif;
list-style: none;
padding: 0;
margin: 0;
background: #FFFFFF;
}
.borderm{
border-right:#606060 0.25px solid;
border-left:#606060 0.25px solid;
}
ul li {
position:relative;
text-align: center;
font-family: 'Roboto', sans-serif;
display: block;
position: relative;
float: right;
background: #FFFFFF;
}
/* This hides the dropdowns */
li ul { display: none;}
ul li a {
font-size: 13px;
font-family: 'Roboto', sans-serif;
display: block;
padding: 1em;
text-decoration: none;
white-space: nowrap;
color: black;
}
/* Display the dropdown */
li:hover > ul {
font-family: 'Roboto', sans-serif;
display: block;
position: absolute;
}
li:hover li { float: none;font-family: 'Roboto', sans-serif;}
li:hover li a:hover { background: #ff4718; color: white;font-family: 'Roboto', sans-serif;}
ul:hover ul{
-webkit-box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) outset;
box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) inset;
-webkit-box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) outset;
-moz-box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) inset;
box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) outset;
}
.main-navigation li ul li { border-top: 0;}
/* Displays second level dropdowns to the right of the first level dropdown */
ul ul ul {
width: 105px;
font-family: 'Roboto', sans-serif;
right: 100.1%;
top: 0;
}
/* Simple clearfix */
ul:before,
ul:after {
font-family: 'Roboto', sans-serif;
content: " "; /* 1 */
display: table; /* 2 */
}
ul:after { clear: both;font-family: 'Roboto', sans-serif;}
.expand{font-size:24px;float: left;margin: -9px -5px;}
.right {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
.left {
transform: rotate(135deg);
-webkit-transform: rotate(135deg);
}
.up {
transform: rotate(-135deg);
-webkit-transform: rotate(-135deg);
}
.down {
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
.effect1{
-webkit-box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) inset;
box-shadow:0 8px 8px rgba(0, 0, 0, 0.3), 0 0 80px rgba(0, 0, 0, 0.1) inset;
/*box-shadow: 1px 1px 0px grey;*/
}
.tri
{
width: 0;
height: 0;
border-top: 25px solid transparent;
border-right: 50px solid #555;
border-bottom: 25px solid transparent;
}
<nav id="bg1" class="navbar">
<ul class="main-navigation">
<li class="w3-center w3-animate-right effect1">Menu</p>
<ul class="effect1" style="right: 0%;">
<li class="w3-center w3-animate-right effect1" style="width: 150px;"><span class="expand">◂</span>Front End Design
<ul class="effect1">
<li class="w3-center w3-animate-right effect1">HTML</li>
<li class="w3-center w3-animate-right effect1"><span class="expand">◂</span>CSS
<ul class="effect1">
<li class="w3-center w3-animate-right effect1">Resets</li>
<li class="w3-center w3-animate-right effect1">Grids</li>
<li class="w3-center w3-animate-right effect1">Frameworks</li>
</ul>
</li>
<li class="w3-center w3-animate-right effect1"><span class="expand">◂</span>Javascript
<ul class="effect1">
<li class="w3-center w3-animate-right effect1">Ajax</li>
<li class="w3-center w3-animate-right effect1">jQuery</li>
</ul>
</li>
</ul>
</li>
<li class="w3-center w3-animate-right effect1">About Us</li>
</li>
</ul>
</li>
<!-- Header Nav End -->
</nav>

If you have so many uls in css, it will be the solution
ul ul ul {
z-index: 1;
}

Related

How do I make the button change color when active

There are two buttons in my sidebar. I want to make my button blue when it's clicked and to remain blue until the other button is clicked. It shouldn't change back to the old color when we click on the body or anywhere else but only when I click the other button.
It would also be nice if someone can show me if those sidebar buttons to turn white again when clicked on the create new button on the navbar.
code sandbox https://codesandbox.io/s/sweet-feynman-2tvy5
css for the buttons
.sideButton {
width: 200px;
height: 50px;
padding-left: 0px;
margin-left: 0px;
padding: 0;
border: none;
font: inherit;
color: inherit;
border-radius: 0 10px 10px 0;
background-color: rgba(191, 191, 191, 0.14);
box-shadow: inset 0 1px 10px 0 rgba(0, 0, 0, 0.15);
position: absolute;
left: 0;
right: 0;
cursor: pointer;
-webkit-box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.17);
-moz-box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.17);
box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.1);
}
.sideButton:focus,
.sideButton:active,
.sideButton.active {
background-color: blue;
}
.sideButton2 {
width: 200px;
height: 50px;
padding-left: 0px;
margin-left: 0px;
margin-top: 55px;
padding: 0;
border: none;
font: inherit;
color: inherit;
border-radius: 0 10px 10px 0;
background-color: white;
box-shadow: inset 0 1px 10px 0 rgba(0, 0, 0, 0.15);
position: absolute;
left: 0;
right: 0;
cursor: pointer;
-webkit-box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.17);
-moz-box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.17);
box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.1);
}
.sideButton2:focus,
.sideButton2:active,
.sideButton2.active {
background-color: blue;
}
the react files where the button is located
import React, { Component } from "react";
import { BrowserRouter as Router, Route, Switch, Link } from "react-router-dom";
import { Nav, Button } from "react-bootstrap";
import "../App.css";
export default class LeftBox extends Component {
constructor(props) {
super(props);
}
render() {
return (
<>
<div className="nav">
<ul>
<li className="list-item">
<Link to="/about">
<input
type="button"
className="sideButton sideBarText"
value="Dashboard"
/>
</Link>
</li>
<li className="list-item">
<Link to="/">
<input
type="button"
className="sideButton2 sideBarText2"
value="People"
/>
</Link>
</li>
</ul>
</div>
</>
);
}
}
You can create your own kind of link that would be in sync with url
import {
Link,
withRouter
} from "react-router-dom";
function NavInput({ value, className, to, location }) {
let isActive = to === location.pathname;
return (
<Link to={to}>
<input
type="button"
className={className + (isActive ? " active" : "")}
value={value}
/>
</Link>
);
}
const NavInputLink = withRouter(NavInput);
and then your leftBox.js would be
export default class LeftBox extends Component {
constructor(props) {
super(props);
}
render() {
return (
<>
<div className="nav">
<ul>
<li className="list-item">
<NavInputLink
to="/about"
value="Dashboard"
className="sideButton sideBarText"
/>
</li>
<li className="list-item">
<NavInputLink
to="/"
value="People"
className="sideButton2 sideBarText2"
/>
</li>
</ul>
</div>
</>
);
}
}
Please check https://codesandbox.io/s/cool-firefly-cq0hr
the easiest way to make this possible is using NavLink
leftBox.js
import React, { Component } from "react";
import {
BrowserRouter as Router,
Route,
Switch,
NavLink
} from "react-router-dom";
import { Nav, Button } from "react-bootstrap";
import "../App.css";
export default class LeftBox extends Component {
constructor(props) {
super(props);
this.state = {
button: false
};
}
render() {
return (
<>
<div className="nav">
<ul>
<li className="list-item">
<NavLink
to="/about"
className="sideButton"
activeClassName="active_navbar"
exact
>
Dashboard
</NavLink>
</li>
<li className="list-item">
<NavLink
to="/"
className="sideButton2"
activeClassName="active_navbar"
exact
>
People
</NavLink>
</li>
</ul>
</div>
</>
);
}
}
Change CSS
.sideButton {
width: 200px;
height: 50px;
padding-left: 0px;
margin-left: 0px;
padding: 0;
border: none;
font: inherit;
color: inherit;
border-radius: 0 10px 10px 0;
background-color: rgba(191, 191, 191, 0.14);
box-shadow: inset 0 1px 10px 0 rgba(0, 0, 0, 0.15);
position: absolute;
left: 0;
right: 0;
/* show a hand cursor on hover; some argue that we
should keep the default arrow cursor for buttons */
cursor: pointer;
-webkit-box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.17);
-moz-box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.17);
box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.1);
}
.sideButton:focus,
.sideButton:active,
.sideButton.active {
/* background-color: rgba(191, 191, 191, 0.14); */
background-color: blue;
}
.sideButton:selected {
background-color: #007bff;
}
.sideButton2 {
width: 200px;
height: 50px;
padding-left: 0px;
margin-left: 0px;
margin-top: 55px;
padding: 0;
border: none;
font: inherit;
color: inherit;
border-radius: 0 10px 10px 0;
background-color: white;
box-shadow: inset 0 1px 10px 0 rgba(0, 0, 0, 0.15);
position: absolute;
left: 0;
right: 0;
cursor: pointer;
-webkit-box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.17);
-moz-box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.17);
box-shadow: inset 0px -1px 28px -1px rgba(0, 0, 0, 0.1);
}
.sideButton2:focus,
.sideButton2:active,
.sideButton2.active {
/* background-color: rgba(191, 191, 191, 0.14); */
background-color: blue;
}
.active_navbar {
background-color: blue;
}
.leftMain {
display: flex;
flex-direction: row;
padding-top: 40px;
}
.rightMain {
display: flex;
padding-top: 20px;
}
ul {
list-style: none;
}
.navbar {
position: fixed;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.7rem 2rem;
overflow: hidden;
z-index: 1;
width: 80%;
margin: auto;
top: 0;
border-bottom: solid 1px var(--primary-color);
opacity: 0.9;
position: relative;
top: 0;
/* box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.25); */
box-shadow: 12px 0 15px -4px rgba(31, 73, 125, 0.8),
-12px 0 8px -4px rgba(31, 73, 125, 0.8);
box-shadow: 0 9px 0px 0px white, 0 -9px 0px 0px white,
12px 0 15px -4px rgba(31, 73, 125, 0.8),
-12px 0 15px -4px rgba(31, 73, 125, 0.8);
}
.navbar ul {
display: flex;
}
.navbar a {
color: #2076d9;
padding: 0.45rem;
margin: 0 0.25rem;
}
.navbar a:hover {
color: var(--primary-color);
}
.navbar .welcome span {
margin-right: 0.6rem;
}
/* dashButton {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
dashButton::after {
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
opacity: 0;
transition: opacity 0.3s ease-in-out;
} */
#media (min-width: 768px) #dashboardpills .nav-item .nav-link {
max-height: 42px;
opacity: 0.25;
color: #000;
font-family: Poppins;
font-size: 30px;
font-weight: 700;
line-height: 42px;
}
a:not([href]):not([tabindex]) {
color: inherit;
text-decoration: none;
}
.nav-pills .nav-link {
border-radius: 0.25rem;
}
.nav-link {
display: block;
padding: 0.5rem 1rem;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
}
*,
::after,
::before {
box-sizing: border-box;
}
user agent stylesheet li {
text-align: -webkit-match-parent;
}
.nav {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding-left: 0;
margin-bottom: 0;
list-style: none;
}
.titleName {
font-family: Poppins;
}
.sideBarText {
color: #000;
font-family: Poppins;
font-size: 18px;
font-weight: 600;
line-height: 25px;
}
.sideBarText2 {
color: #000;
font-family: Poppins;
font-size: 18px;
font-weight: 600;
line-height: 25px;
}
.createNew {
height: 40px;
width: 153px;
border: 0px;
border-radius: 10px;
/* background-color: #2076d9; */
background-image: linear-gradient(
to top,
#d83f91,
#d0409b,
#c743a5,
#bb47af,
#ae4bb8
);
box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.25);
}
.signOut {
border: 0px;
height: 40px;
width: 100px;
border-radius: 10px;
background-image: linear-gradient(
to right,
#eb3941,
#f15e64,
#e14e53,
#e2373f
);
box-shadow: 0 5px 15px rgba(242, 97, 103, 0.4);
box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.25);
}
.mainCom {
height: 56px;
width: 68px;
color: #000;
font-family: Poppins;
font-size: 40px;
font-weight: 700;
line-height: 56px;
left: 0;
cursor: pointer;
}
.mainComS {
height: 42px;
width: 255px;
opacity: 0.25;
color: #000;
font-family: Poppins;
font-size: 24px;
font-weight: 700;
line-height: 42px;
cursor: pointer;
}
.mainComS2 {
height: 42px;
width: 200px;
opacity: 0.25;
color: #000;
font-family: Poppins;
text-align: center;
font-size: 24px;
font-weight: 700;
line-height: 42px;
cursor: pointer;
}
.conMain {
height: 130vh;
margin-top: 20px;
width: 100%;
box-shadow: 12px 0 15px -4px rgba(31, 73, 125, 0.8),
-12px 0 8px -4px rgba(31, 73, 125, 0.8);
box-shadow: 0 9px 0px 0px white, 0 -9px 0px 0px white,
12px 0 15px -4px rgba(31, 73, 125, 0.8),
-12px 0 15px -4px rgba(31, 73, 125, 0.8);
}
ul {
list-style: none;
}
li:hover {
cursor: pointer;
}
You will get your all solution in it
You can change your class dynamically. Hitt the upvote if use like it.
$(document).ready(function(){
$("li").click(function() {
if($(this).siblings('li').find('input').hasClass('active')) {
$(this).siblings('li').find('input').removeClass('active');
$(this).find('input').addClass('active');
}
});
});
li {
list-style: none;
padding-right: 20px;
display: inline-block;
}
li .btn {
padding: 7px 20px;
background: #fff;
border: 1px solid #000;
font-size: 16px;
color: #000;
outline: none;
}
li .btn.active {
color: #fff;
background: #000;
border: 1px solid #000;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="wrap">
<ul>
<li>
<input class="btn active" type="button" name="Button 1" value="btn1">
</li>
<li>
<input class="btn" type="button" name="Button 3" value="btn2">
</li>
</ul>
</div>
Well, one of your ways to accomplish this, you can do is, make a state in your class, like:
state={mycolor:"red"};
And your button be like:
<button style={{color:this.state.mycolor}}
onClick={()=>this.colorhandler()}>click here</button>
And in your class define your colorhandler
colorhandler(){
this.setState({mycolor:"blue"});
}
And when you click on the button the color will change,
hope you get the idea and works for you
update
If you want keep your CSS files you can change code like this:
state={myclassname:"btn active"};
< button class={ this.state.myclassname}
onClick={ ()=>this.Classhandler()}> click here </ button>
Classhandler(){
this.setState({myclassname:"btn deactive"});
}

Getting blank white space to the left of content inside pre tags

Everything inside the pre tag currently is not being aligned left. It starting from I dont know its not even middle.
How do I style the content container in the correct way?
I have tried a few things, but it didn't work as expected.
Why I am getting a huge blank space to the left inside the content of the pre tag.
.d-lg-block {
display: block!important;
}
.code-examples {
box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
margin: 0 0 40px;
}
.code-examples .nav-pills {
background-size: 100%;
background-image: linear-gradient(#555555, #444444);
border: 1px solid #444;
border-radius: 5px 5px 0 0;
zoom: 1;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
list-style: none;
line-height: normal;
margin: 0;
padding: 5px 10px;
position: relative;
z-index: 1;
}
.code-examples .nav-pills:before,
.code-examples .nav-pills:after {
content: '\0020';
display: block;
height: 0;
overflow: hidden;
}
.code-examples .nav-pills li {
display: inline;
}
.code-examples .nav-pills {
background-size: 100%;
background-image: linear-gradient(#555555, #444444);
border: 1px solid #444;
border-radius: 5px 5px 0 0;
zoom: 1;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
list-style: none;
line-height: normal;
margin: 0;
padding: 5px 10px;
position: relative;
z-index: 1;
height: 40px;
}
.code-examples .nav-pills li a {
color: #ccc;
display: inline-block;
line-height: normal;
float: left;
font-size: 14px;
padding: 3px 20px;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.code-examples .nav-pills li.active a {
background-size: 100%;
background-image: linear-gradient(#222222, #444444);
border-radius: 25px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.2);
color: #fff;
line-height: normal;
}
.code-examples .tab-content {
background: #333;
bottom: 0;
box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
box-sizing: border-box;
margin-bottom: -80px;
margin-top: 30px;
position: absolute;
top: 0;
}
/*.code-examples .tab-content pre {
background: transparent;
border: 0 !important;
bottom: 0;
color: #fff;
font-family: 'Ubuntu Mono', 'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter', monospace;
font-size: 13px;
left: 20px;
line-height: 1.4;
margin: 0;
position: absolute;
right: 20px;
top: 20px;
}*/
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="d-lg-block">
<div id="quickstart_code_samples" class="code-examples">
<ul class="nav-pills">
<li class="active">Curl</li>
<li class=""> Ruby</li>
<li class=""> Python</li>
<li class=""> Php</li>
</ul>
<div class="tab-content">
<pre id="curlsample" class="tab-pane ace_editor ace-monokai ace_dark active" style="display: block;">
slksdk
sdflkdsfkld
sdflksdlkf
ldsksd
ddsds
</pre>
<pre id="rubysample" class="tab-pane ace_editor ace-monokai ace_dark" style="display: none;">
slksdk
sdflkdsfkld
sdflksdlkf
ldsksd
</pre>
</div>
</div>
</div>
It's in the middle because you have spaces there :D
It's TAB indented.
<pre>
Indented stuff
Indented stuff
</pre>
<pre>
Aligned left
Aligned left
</pre>
I have fix your code. try out this. you cant add pre. pre is use to show exact code block on screen. because of using pre tag you are getting more space in front of your list. I have added pre and div for you. use whatever you need.
.d-lg-block {
display: block!important;
}
.code-examples {
box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
margin: 0 0 40px;
}
.code-examples .nav-pills {
background-size: 100%;
background-image: linear-gradient(#555555, #444444);
border: 1px solid #444;
border-radius: 5px 5px 0 0;
zoom: 1;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
list-style: none;
line-height: normal;
margin: 0;
padding: 5px 10px;
position: relative;
z-index: 1;
}
.code-examples .nav-pills:before,
.code-examples .nav-pills:after {
content: '\0020';
display: block;
height: 0;
overflow: hidden;
}
.code-examples .nav-pills li {
display: inline;
}
.code-examples .nav-pills {
background-size: 100%;
background-image: linear-gradient(#555555, #444444);
border: 1px solid #444;
border-radius: 5px 5px 0 0;
zoom: 1;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
list-style: none;
line-height: normal;
margin: 0;
padding: 5px 10px;
position: relative;
z-index: 1;
height: 40px;
}
.code-examples .nav-pills li a {
color: #ccc;
display: inline-block;
line-height: normal;
float: left;
font-size: 14px;
padding: 3px 20px;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
background-size: 100%;
background-image: linear-gradient(#222222, #444444);
border-radius: 25px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.2);
color: #fff;
line-height: normal;
}
.code-examples .tab-content {
box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
box-sizing: border-box;
padding: 20px;
}
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<div class="d-lg-block">
<div id="quickstart_code_samples" class="code-examples">
<ul class="nav-pills nav " id="myTab" role="tablist">
<li class="nav-item ">
<a class="nav-link active" id="curl-tab" data-toggle="tab" href="#curlsample" role="tab" aria-controls="curlsample" aria-selected="true">Curl</a>
</li>
<li class="nav-item">
<a class="nav-link" id="ruby-tab" data-toggle="tab" href="#rubysample" role="tab" aria-controls="rubysample" aria-selected="false">Ruby</a>
</li>
<li class=""> Python</li>
<li class=""> Php</li>
</ul>
<div class="tab-content col-md-12" id="myTabContent">
<div id="curlsample" class="tab-pane fade show ace_editor ace-monokai ace_dark active" role="tabpanel" aria-labelledby="curl-tab">
<pre>
slksdk
sdflkdsfkld
sdflksdlkf
ldsksd
ddsds
</pre>
</div>
<div id="rubysample" class="tab-pane fade ace_editor ace-monokai ace_dark" role="tabpanel" aria-labelledby="ruby-tab">
slksdk sdflkdsfkld sdflksdlkf ldsksd
</div>
</div>
</div>
</div>

Align ul with img

I am trying to get my links in a ul to align with the image and text so I can have a good navbar, but for some reason it goes below everything. How can I fix this?
body {
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
}
#tagline {
font-style: italic;
}
nav {
background-color: white;
-webkit-box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
}
#logo {
padding: 10px 10px 10px 10px;
vertical-align: middle;
}
li,
a {
text-decoration: none;
list-style-type: none;
color: black;
display: inline-block;
float: right;
}
<nav>
<img src="https://s1.postimg.org/qiu818fhr/lb_logo.png" id="logo" alt="logo">
<span id="tagline">Live, 1-to-1, flexible and personalized</span>
<ul id="nav-items">
<li>How it Works</li>
<li>Courses</li>
<li>Teachers</li>
<li>Enroll</li>
<li>Login</li>
</ul>
</nav>
apply display:flex to nav and why not removing float:right from li as well?
body {
margin: 0;
font-family: 'Open Sans', sans-serif;
}
#tagline {
font-style: italic;
}
nav {
background-color: white;
-webkit-box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
display: flex;
align-items: center;
}
#logo {
padding: 10px;
}
ul {
margin-left: auto;
}
li,
a {
text-decoration: none;
list-style-type: none;
color: black;
display: inline-flex;
}
<nav>
<img src="https://s1.postimg.org/qiu818fhr/lb_logo.png" id="logo" alt="logo">
<span id="tagline">Live, 1-to-1, flexible and personalized</span>
<ul id="nav-items">
<li>How it Works</li>
<li>Courses</li>
<li>Teachers</li>
<li>Enroll</li>
<li>Login</li>
</ul>
</nav>
You want to float the #nav-items list right, since that's a block element. Then display: inline-block on the li's, and color/text-decoration on the a's
body {
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
}
#tagline {
font-style: italic;
}
nav {
background-color: white;
-webkit-box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
}
#logo {
padding: 10px 10px 10px 10px;
vertical-align: middle;
}
#nav-items {
float: right;
}
li {
display: inline-block;
}
a {
text-decoration: none;
color: black;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>LanguageBird</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<nav>
<img src="img/lb_logo.png" id="logo" alt="logo">
<span id="tagline">Live, 1-to-1, flexible and personalized</span>
<ul id="nav-items">
<li>How it Works</li>
<li>Courses</li>
<li>Teachers</li>
<li>Enroll</li>
<li>Login</li>
</ul>
</nav>
<script src="main.js"></script>
</body>
</html>
If you want to use a flex layout, apply display: flex; to nav, and use align-items to center vertically. Then assign margin-left: auto to #nav-items to push that menu to the right.
body {
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
}
#tagline {
font-style: italic;
}
nav {
background-color: white;
-webkit-box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
box-shadow: 0px 6px 7px -2px rgba(0, 0, 0, 0.75);
}
#logo {
padding: 10px 10px 10px 10px;
vertical-align: middle;
}
li {
display: inline-block;
}
a {
color: black;
text-decoration: none;
}
nav {
display: flex;
align-items: center;
}
#nav-items {
margin-left: auto;
}
<nav>
<img src="https://s1.postimg.org/qiu818fhr/lb_logo.png" id="logo" alt="logo">
<span id="tagline">Live, 1-to-1, flexible and personalized</span>
<ul id="nav-items">
<li>How it Works</li>
<li>Courses</li>
<li>Teachers</li>
<li>Enroll</li>
<li>Login</li>
</ul>
</nav>

Button on hover flashes a glitchy black border?

When I hover over one of these buttons it flashes a black border and then it disappears. There is no border in the code. I am also using Chrome if that causes any issues. I do not want the border here.
Here is the code:
body {
background: #5544aa;
}
nav {
background: rgba(0, 0, 0, .2);
border-radius: 0px;
box-shadow: 2px 2px 3px rgba(255,255,255,0.1), -2px -2px .5px rgba(0,0,0,0.3);
}
nav ul {
width: 950px;
margin: 0 auto;
}
nav ul li {
list-style-type: none;
width: 150px;
margin-top: 15px;
float: left;
border: none;
text-align: center;
}
li a {
text-decoration: none;
color: #555555;
border-radius: 0px;
box-shadow: 0 0 0 #000;
text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
line-height: 50px;
display: block;
transition: all ease-in-out 250ms;
}
li a:hover {
background: rgba(255, 255, 255, .1);
box-shadow: 0 8px 8px -6px #333, inset 0 0 3px rgba(0,0,0,0.1);
color: #222222;
padding: 0px 0px;
text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
}
<nav>
<ul>
<li> Home
</li>
<li> Products
</li>
<li> Contacts
</li>
<li> About
</li>
</ul>
</nav>
It will be your box-shadow transitioning. To stop it, you'll need to edit your transition from all to just the CSS rules you want to transition.
I fixed it. I needed to delete the box-shadow: 0 0 0 #000; in the li a { } part. Now it works just fine.

CSS/HTML Slider... <li> reverse direction needed

This is CSS/html based Slider is but i want in reverse direction.. first < li > image should come up and so on... in fact i want direct of slides should be from LEFT to RIGHT.. not right to left...
http://jsfiddle.net/Qrw76
HTML Code here
<div class="accordian">
<ul>
<li>
<div class="image_title"></div>
<img src="http://placehold.it/640x348"/>
</li>
<li>
<div class="image_title"></div>
<img src="http://placehold.it/640x348"/>
</li>
<li>
<div class="image_title"></div>
<img src="http://placehold.it/640x348"/>
</li>
<li>
<div class="image_title"></div>
<img src="http://placehold.it/640x348"/>
</li>
<li>
<div class="image_title"></div>
<img src="http://placehold.it/640x348"/>
</li>
</ul>
</div>
CSS here
===========
* {
margin: 0;
padding: 0;
}
.accordian {
width: 820px; height: 348px;
overflow: hidden;
/*Time for some styling*/
margin: 100px auto;
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.35);
-moz-box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.35);
}
/*A small hack to prevent flickering on some browsers*/
.accordian ul {
width: 2000px;
/*This will give ample space to the last item to move
instead of falling down/flickering during hovers.*/
}
.accordian li {
position: relative;
display: block;
width: 120px;
float: left;
border-left: 1px solid #888;
box-shadow: 0 0 25px 10px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0 0 25px 10px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 0 25px 10px rgba(0, 0, 0, 0.5);
/*Transitions to give animation effect*/
transition: all 0.5s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
/*If you hover on the images now you should be able to
see the basic accordian*/
}
/*Reduce with of un-hovered elements*/
.accordian ul:hover li {width: 40px;
}
/*Lets apply hover effects now*/
/*The LI hover style should override the UL hover style*/
.accordian ul li:hover {width: 600px;
}
.accordian li img {
display: block;
}
/*Image title styles*/
.image_title {
background: rgba(0, 0, 0, 0.5);
position: absolute;
left: 0; bottom: 0;
width: 640px;
}
.image_title a {
display: block;
color: #fff;
text-decoration: none;
padding: 20px;
font-size: 16px;
}