I have the following code:
.chat-content {
height: 455px;
min-height: 100%;
width: 100%;
overflow-y: auto;
background: #cacac8;
}
.chat-content,
.chat-content-inner {
position: relative;
}
.chat-container {
position: relative;
overflow: hidden;
}
.top-buttons {
position: relative;
display: block;
padding: 10px;
padding-left: 80px;
height: 50px;
background: #dddddb;
top: 0;
right: 0;
left: 0
}
.top-buttons .badge {
position: relative;
border-radius: 3px;
padding: 7px;
margin-left: 10px;
margin-top: 5px;
}
.top-buttons .badge:after {
content: "";
position: absolute;
top: 5px;
left: -5px;
border-style: solid;
border-width: 5px 5px 5px 0px;
border-color: transparent #999;
display: block;
width: 0;
z-index: 1;
}
.top-buttons h2 {
font-weight: 300;
color: #858689
}
.chat-pusher {
position: relative;
}
/*Styling Chat Sidebar Menu*/
.chat-users-menu {
position: absolute;
top: 0;
left: -110px;
z-index: 100;
visibility: visible;
width: 180px;
height: 100%;
background: #858689;
-webkit-transition: all .5s;
transition: all .5s;
overflow-y: auto;
}
/*Toggle Class for Moving Chat Menu Users*/
.chatbar-toggle {
left: 0;
}
/*/Toggle Class for Moving Chat Menu Users*/
.chat-users-menu ul {
margin: 0;
padding: 0;
list-style: none;
}
.chat-users-menu .menu-header {
padding: 10px;
text-align: right;
color: #fff;
font-size: 1.5em;
}
.chat-users-menu ul li a {
position: relative;
display: block;
height: 70px;
padding: 15px 90px 10px 10px;
outline: none;
box-shadow: inset 0 -1px rgba(0, 0, 0, .2);
color: #fff;
text-shadow: 0 0 1px rgba(255, 255, 255, .1);
font-weight: 700;
-webkit-transition: background .3s, box-shadow .3s;
transition: background .3s, box-shadow .3s;
}
.chat-users-menu ul li a .chat-name {
display: block;
text-overflow: ellipsis;
width: 100px;
font-size: 1.05em;
}
.chat-users-menu ul li a .badge {
position: absolute;
background: #d24d33;
color: #fff;
top: 10px;
right: 10px;
}
.chat-users-menu ul li a:hover {
background: rgba(0, 0, 0, .2);
color: #fff;
text-decoration: none;
}
.chat-users-menu ul li a .label {
margin-top: 2px;
}
.chat-users-menu ul li .user-img {
position: absolute;
right: 15px;
top: 15px;
display: block;
max-width: 40px;
}
.chat-users-menu ul li .user-img img {
display: inline-block;
max-width: 100%;
border-radius: 50%;
box-shadow: 0 0 0 5px #fff;
}
/* And finally! Messages List and Chat Contents */
.chat-messages {
padding: 15px;
margin-bottom: 5px;
}
.chat-messages-with-sidebar {
margin-left: 70px;
}
.chat-messages ul {
list-style: none;
margin: 0;
padding: 0;
}
.chat-messages li {
margin-bottom: 10px;
}
.chat-messages li.left .chat-body {
position: relative;
margin-left: 70px;
padding: 10px;
background: #fff;
border-radius: 3px;
}
.chat-messages li.left .chat-body :before {
/*content: "";
position: absolute;
top: 20%;
left: -7px;
border-style: solid;*/
border-width: 6px 7px 6px 0;
border-color: transparent #fff;
/*display: block;
width: 0;*/
}
.chat-messages li.right .chat-body {
position: relative;
margin-right: 70px;
padding: 10px 15px;
background: #fff;
border-radius: 3px;
}
.chat-messages li.right .chat-body :after {
content: "";
position: absolute;
top: 20%;
right: -7px;
border-style: solid;
border-width: 6px 0 6px 7px;
border-color: transparent #fff;
display: block;
width: 0;
}
.chat-messages .badge {
font-size: .85em;
float: right;
border-radius: 3px;
background: #c0c2c7;
}
.chat-messages .chat-body .name {
font-size: 1em;
font-weight: 700;
}
.chat-messages .user-img {
margin-top: 8px;
display: block;
max-width: 45px;
}
.chat-messages .user-img img {
display: inline-block;
max-width: 100%;
border-radius: 50%;
box-shadow: 0 0 0 6px #fff;
}
.chat-message-form {
padding: 15px;
background: #dddddb;
display: block
}
.nano {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.nano>.nano-content {
position: absolute;
overflow: scroll;
overflow-x: hidden;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.nano>.nano-content:focus {
outline: thin dotted;
}
.nano>.nano-content::-webkit-scrollbar {
visibility: hidden;
}
.has-scrollbar>.nano-content::-webkit-scrollbar {
visibility: visible;
}
.nano>.nano-pane {
background: rgba(0, 0, 0, .25);
position: absolute;
width: 10px;
right: 0;
top: 0;
bottom: 0;
visibility: hidden\9;
/* Target only IE7 and IE8 with this hack */
opacity: .01;
-webkit-transition: .2s;
-moz-transition: .2s;
-o-transition: .2s;
transition: .2s;
}
.nano>.nano-pane>.nano-slider {
background: #fff;
position: relative;
margin: 0;
}
.nano:hover>.nano-pane,
.nano-pane.active,
.nano-pane.flashed {
visibility: visible\9;
/* Target only IE7 and IE8 with this hack */
opacity: 0.99;
}
.msg-is-typing-container {
position: absolute;
bottom: 0;
}
<div class="chat-container">
<div class="chat-pusher">
<div class="chat-content">
<!-- this is the wrapper for the content -->
<div class="nano">
<!-- this is the nanoscroller -->
<div class="nano-content">
<div class="">
<!-- extra div for emulating position:fixed of the menu -->
<!-- Top Navigation -->
<div class="">
<div class="chat-messages chat-messages-with-sidebar">
<ul id="thread-msg-content" data-msg-thread-id="">
<li class="left clearfix">
<div class="user-img pull-left">
<img src="http://www.simpsonspark.com/images/persos/contributions/bart-simpson-20516.gif" alt="User Avatar" width="50" height="50" />
</div>
<div class="chat-body clearfix">
<div class="header"> <span class="name">Administrator</span><span class="name"></span> <span class="badge"><i class="fa fa-clock-o"></i>2018-06-21 04:38:44</span> …
<div class="chat-body clearfix">
<p>fdfdffdfddfd</p>
</div>
</li>
<li class="left clearfix">
<div class="user-img pull-left">
<img src="http://www.simpsonspark.com/images/persos/contributions/bart-simpson-20516.gif" alt="User Avatar" width="50" height="50" />
</div>
<div class="chat-body clearfix">
<div class="header"> <span class="name">Administrator</span><span class="name"></span> <span class="badge"><i class="fa fa-clock-o"></i>2018-06-21 04:38:44</span> …
<div class="chat-body clearfix">
<p>fdfdffdfddfd</p>
</div>
</li>
<li class="left clearfix">
<div class="user-img pull-left">
<img src="http://www.simpsonspark.com/images/persos/contributions/bart-simpson-20516.gif" alt="User Avatar" width="50" height="50" />
</div>
<div class="chat-body clearfix">
<div class="header"> <span class="name">Administrator</span><span class="name"></span> <span class="badge"><i class="fa fa-clock-o"></i>2018-06-21 04:38:44</span> …
<div class="chat-body clearfix">
<p>fdfdffdfddfd</p>
</div>
</li>
</ul>
<div class="msg-is-typing-container">
<p class="msg-is-typing">Administrator is typing ...</p>
</div>
</div>
</div>
</div>
<!-- /chat-content-inner -->
</div>
</div>
<!-- /nano -->
</div>
<!-- /chat-content -->
</div>
<!-- /chat-pusher -->
</div>
Result I want: https://www.awesomescreenshot.com/image/3438835/f249eeacac535cd7715d72d9c3b1dcb4
I want to show div ".msg-is-typing-container" to the bottom of the container ".chat-content", but when the scroll bar is shown the div ".msg-is-typing-container" is not displayed at the bottom of the container.
How to fix this issue?
Thank you!
I altered .msg-is-typing-container's CSS to achieve the positioning I believe you want.
.msg-is-typing-container{
position: relative;
border: 1px solid red;
display: inline-block;
padding: 5px 10px;
}
I then added a matching id as shown to this element: <p class="msg-is-typing" id="msg-is-typing"></p>
The below jQuery & JavaScript hides the typing container .msg-is-typing-container until the .nano-content container is scrolled to the bottom, at which time the container fades into view. I also added a JavaScript typing effect found here at w3Schools. You can see this JSFiddle where I tried to answer the question as I understood it.
$('.msg-is-typing-container').hide();
$(document).ready(function() {
var i = 0;
var txt = 'Administrator is typing ...And Only Shows when div is scolled to bottom';
var speed = 100;
function typeWriter() {
if (i < txt.length ) {
document.getElementById("msg-is-typing").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
$(".nano-content").scroll(function(){
if ($(this).scrollTop()>0) {
$('.msg-is-typing-container').fadeIn(2000);
}
else{
$('.msg-is-typing-container').fadeOut(1000);
}
})
typeWriter();
})
.chat-messages {
position: relative;
margin: 50px;
}
.msg-is-typing-container{
position:absolute;
bottom:-25px;
}
Related
I have a list of div elements that act as buttons. They have hover functionality from its CSS. I am placing them all in horizontal line. But I want them to be placed vertically that is one after another in the same line. I am not sure how I can do it since the width attribute places it in the same line.
How do I place them as new line function with certain equal distance?
body {
margin: 0;
font-family: 'Roboto Condensed', sans-serif;
}
h1 {
color: #333;
font-weight: 700;
margin-top: 125px;
text-align: center;
text-transform: uppercase;
letter-spacing: 4px;
line-height: 23px;
}
/* --- Start progress bar --- */
.process-wrapper {
margin: auto;
max-width: 1080px;
}
#progress-bar-container {
position: relative;
width: 90%;
margin: auto;
height: 100px;
margin-top: 65px;
}
#progress-bar-container ul {
padding: 0;
margin: 0;
padding-top: 15px;
z-index: 9999;
position: absolute;
width: 100%;
margin-top: -40px
}
#progress-bar-container li:before {
content: " ";
display: block;
margin: auto;
width: 30px;
height: 30px;
border-radius: 50%;
border: solid 2px #aaa;
transition: all ease 0.3s;
}
#progress-bar-container li.active:before,
#progress-bar-container li:hover:before {
border: solid 2px #fff;
background: linear-gradient(to right, #1a00aa 0%, rgb(0, 81, 255) 100%);
}
#progress-bar-container li {
list-style: none;
float: left;
width: 20%;
text-align: center;
color: #aaa;
text-transform: uppercase;
font-size: 11px;
cursor: pointer;
font-weight: 700;
transition: all ease 0.2s;
vertical-align: bottom;
height: 60px;
position: relative;
}
#progress-bar-container li .step-inner {
position: absolute;
width: 100%;
bottom: 0;
font-size: 14px;
}
#progress-bar-container li.active,
#progress-bar-container li:hover {
color: #444;
}
#progress-bar-container li:after {
content: " ";
display: block;
width: 6px;
height: 6px;
background: #777;
margin: auto;
border: solid 7px #fff;
border-radius: 50%;
margin-top: 40px;
box-shadow: 0 2px 13px -1px rgba(0, 0, 0, 0.3);
transition: all ease 0.2s;
}
#progress-bar-container li:hover:after {
background: #555;
}
#progress-bar-container li.active:after {
background: #207893;
}
<div class="process-wrapper">
<div id="progress-bar-container">
<ul>
<li class="step step01 active">
<div class="step-inner">A</div>
</li>
<li class="step step02">
<div class="step-inner">B</div>
</li>
<li class="step step03">
<div class="step-inner">C</div>
</li>
<li class="step step04">
<div class="step-inner">D</div>
</li>
<li class="step step05">
<div class="step-inner">E</div>
</li>
</ul>
</div>
</div>
Just add flex and flex-direction as column to the ul tag.
#progress-bar-container ul{
display:flex;
flex-direction:column;
padding: 0;
margin: 0;
padding-top: 15px;
z-index: 9999;
position: absolute;
width: 100%;
margin-top: -40px
}
For more information just look at this link
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
I am have a menu for my website and which is currently align on the left side of the browser. I am try to align on the right side of the browser.
here is the demo: here
what I want is just put the hole menu and align it on the right side of the browser screen. currently its showing on the left side.
trying to do:https://i.stack.imgur.com/D0y00.png
html code:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<header>
<span class="toggle-button">
<div class="menu-bar menu-bar-top"></div>
<div class="menu-bar menu-bar-middle"></div>
<div class="menu-bar menu-bar-bottom"></div>
</span>
<div class="menu-wrap">
<div class="menu-sidebar">
<ul class="menu">
<li>Home</li>
<li class="children">News
<span class="arrow"></span>
<ul class="child-menu ">
<li>Link 1</li>
<li>Link 2</li>
<li>link 3</li>
</ul>
</li>
<li class="children">Contact
<span class="arrow"></span>
<ul class="child-menu ">
<li>Link 1</li>
<li>Link 2</li>
<li>link 3</li>
</ul>
</li>
<li class="children">About
<span class="arrow"></span>
<ul class="child-menu ">
<li>Link 1</li>
<li>Link 2</li>
<li>link 3</li>
</ul>
</li>
<li>FAQ</li>
<li>Services</li>
</ul>
</div>
</div>
</header>
<div class="wrapper" style="background-color:;padding:15px;">
<section class="text" style="background-color:;">
<h2 class="heading" id="headings" style="background-color:;text-align:center;">Three Line Menu & CSS Transitions</h2>
<p class="buttons" style="min-width: 200px;margin:auto;background-color:;text-align:center;">
Learn More
</p>
</section>
</div>
CSS:
html {
background: url(https://s33.postimg.cc/tm1vd9yy7/Background_2.jpg);
background-attachment:fixed;
background-repeat: no-repeat;
background-size: cover;
}
.btn_one {
text-decoration: none;
color: white;
font-weight: 100;
border: 1px #fbbc05 solid;
padding: 1em 3em;
border-radius: 100px;
}
a {
text-decoration: none;
}
ul {
padding-left: 0;
}
li {
list-style: none;
}
* {
box-sizing: border-box;
}
body {
font-family: 'Montserrat', Arial, serif;
}
::selection {
background-color: #EBEBF2;
color: #83828D;
}
/* ==================================== */
/* Navigaton Menu */
/* ==================================== */
.menu-wrap {
background-color: #625871;
position: fixed;
top: 0;
height: 100%;
width: 280px;
margin-left: -280px;
font-size: 1em;
font-weight: 700;
overflow: auto;
transition: .25s;
z-index: 10;
}
.menu-show {
margin-left: 0;
box-shadow: 4px 2px 15px 1px #262424;
}
.menu-sidebar {
margin: 75px 0 80px 10px;
position: relative;
top: 70px;
}
.menu-sidebar li {
padding: 18px 22px 0;
}
.menu-sidebar li > a {
color: #f3f3f3;
font-size: 1.18em;
position: relative;
}
.menu-sidebar li > a::after {
content: "";
display: block;
height: 0.15em;
position: absolute;
top: 100%;
width: 100%;
left: 50%;
transform: translate(-50%);
background-image: linear-gradient(to right, transparent 50.3%, #FFFA3B 50.3%);
transition: background-position .2s .1s ease-out;
background-size: 200% auto;
}
.menu-sidebar li > a:hover::after {
background-position: -100% 0;
}
.menu-sidebar .children {
position: relative;
}
.menu-sidebar .children .child-menu {
display: none;
}
.arrow::after {
content: "\f107";
font-family: 'FontAwesome';
padding: 10px;
color: #FFFA3B;
position: relative;
}
.arrow:hover::after {
cursor: pointer;
color: #fff;
}
.arrow:active::after {
top: 2px;
}
/*Hamburger Button*/
.toggle-button {
position: fixed;
width: 44px;
height: 40px;
top: 50px;
left: 40px;
padding: 4px;
transition: .25s;
z-index: 15;
}
.toggle-button:hover {
cursor: pointer;
}
.toggle-button .menu-bar {
position: absolute;
border-radius: 2px;
transition: .5s;
}
.toggle-button .menu-bar-top {
border: 4px solid #fff;
border-bottom: none;
top: 0;
width: 80%;
}
.toggle-button .menu-bar-middle {
height: 4px;
background-color: #fff;
margin-top: 7px;
margin-bottom: 7px;
width: 40%;
top: 4px;
}
.toggle-button .menu-bar-bottom {
border: 4px solid #fff;
border-top: none;
top: 22px;
width: 60%;
}
.toggle-button:hover div
{
width: 80%;
}
.button-open {
left: 25px;
}
.button-open .menu-bar-top {
border-color: #fff;
transform: rotate(45deg) translate(8px, 8px);
transition: .5s;
}
.button-open .menu-bar-middle {
background-color: #fff;
transform: translate(230px);
transition: .1s ease-in;
opacity: 0;
}
.button-open .menu-bar-bottom {
border-color: #fff;
transform: rotate(-45deg) translate(7px, -7px);
transition: .5s;
}
/* Text Block */
.wrapper {
width: 40%;
margin: 100px auto 0;
color: #83828D;
}
.wrapper .text {
padding: 30px;
}
.wrapper .text .heading {
margin-bottom: 40px;
font-size: 2em;
color:#fff;
}
.wrapper .text p {
line-height: 1.6em;
}
.wrapper .text .buttons {
margin-top: 40px;
}
/* Buttons */
.wrapper .buttons .button {
display: inline-block;
margin-right: 20px;
padding: 20px 25px;
border-radius: 2em;
background-color: #70CE64;
color: #fff;
font-size: .9em;
font-weight: 700;
transition: background-color .3s;
}
.wrapper .buttons .button-secondary {
background-color: #FF6746;
}
.wrapper .buttons .button-primary:hover {
background-color: #84D07A;
}
.wrapper .buttons .button-secondary:hover {
background-color: #FF7D60;
}
/*Active state for the buttons*/
.wrapper .buttons .button-primary:active {
background-color: #70CE64;
}
.wrapper .buttons .button-secondary:active {
background-color: #FF6746;
}
/*Icons*/
.wrapper .buttons .button span {
position: relative;
display: inline-block;
padding-right: 20px;
}
.wrapper .buttons .button span::after {
position: absolute;
font-family: "FontAwesome";
right: -3px;
font-size: 14px;
top: 0;
transition: top .3s, right .3s;
}
.wrapper .buttons .button-primary span::after {
content: "\f019";
}
.wrapper .buttons .button-secondary span::after {
content: "\f178";
}
/*Slight icons animation*/
.wrapper .buttons .button-primary:hover span::after {
top: 4px;
}
.wrapper .buttons .button-secondary:hover span::after {
right: -6px;
}
#media screen and (max-width: 480px) {
#headings{
margin-bottom:20px;
font-size: 18px;
color:#fff;
}
.btn_one {
text-decoration: none;
color: #fff;
font-size:12px;
font-weight: 100;
border: 1px #fbbc05 solid;
padding: 8px 23px;
border-radius: 100px;
}
ul {
padding-left: 35px;
}
.menu-sidebar li
{
padding:0;
}
.menu-wrap {
width: 200px;
}
}
SCRIPT:
$(document).ready(function() {
var $toggleButton = $('.toggle-button'),
$menuWrap = $('.menu-wrap'),
$sidebarArrow = $('.arrow');
// Hamburger button
$toggleButton.on('click', function() {
$(this).toggleClass('button-open');
$menuWrap.toggleClass('menu-show');
});
// Sidebar navigation arrows
$sidebarArrow.click(function() {
$(this).next().slideToggle(300);
});
});
Here is the source code for reference: https://nofile.io/f/9bKHsuOoUza/source_code_new.zip
Can anybody guide me? Any input is appreciated.
Thank you so much.
change the toggle button to:
default:
.toggle-button {
position: fixed;
width: 44px;
height: 40px;
top: 50px;
left: auto;
padding: 4px;
transition: .25s;
z-index: 15;
right: 40px;
}
open:
.button-open {
left: auto;
right: 25px;
}
then change the menu to:
closed:
.menu-wrap {
background-color: #00000030;
position: fixed;
top: 0;
height: 100%;
width: 240px;
margin-left: 0;
right: -280px;
font-size: 1em;
font-weight: 700;
overflow: auto;
transition: .25s;
z-index: 10;
left: auto;
}
open:
.menu-show {
left: auto;
right: 0;
margin-left: 0;
box-shadow: 4px 2px 15px 1px #080707;
}
easy as that!
Code I made is not working properly it's working in DW but not in Chrome . In Chrome I have to resize the screen then it change but when I open it in responsive mode it shows zoomed out version.
Here's the code
<!DOCTYPE><html>
<head>
<meta content="width=device-width,initial-scale=1.0">
<title>Shivam | Home</title>
<style type="text/css">
body {
margin: 0;
font-family: cursive;
font-size: 20px;
width: 100%;
height: 5000px;
}
/*menu*/
.nav {
position: fixed;
width: 100%;
max-height: 180px;
z-index: 999;
margin: 0;
padding-left:0;
background: #eee;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}
.nav li {
float: right;
list-style-type: none;
position: relative;
font-size: 1em;
color: #111;
display: block;
line-height: 3em;
overflow: hidden;
}
.nav li a {
color: #111;
display: block;
padding: 0 26px;
text-decoration: none;
transition: 0.25s all ease;
overflow: hidden;
}
.actv{
background: #08f;
color: #fff;
box-shadow: 0 0 5px rgba(0, 136, 255, 0.5);
transition: 1s ease;
}
.navback{
background: #eee;
position: fixed;
width: 100%;
z-index: 998;
height: 60px;
border-bottom: #08f solid 2px;
}
.logo{
background: #08f;
cursor: default;
}
.sm{
width: 0;
height: 0;
border-left: 30px solid #08f;
border-bottom: 30px solid transparent;
border-top: 30px solid transparent;
padding: 0 0 0 15;
}
/*side bar*/
#btn{
color: #111;
cursor: pointer;
transition:1s;
padding-left:50px;
float:right;
font-size: 25px;
line-height: 60px;
}
.overlay {
height: 100%;
width: 0%;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
background: #08f;
overflow: hidden;
transition: 0.5s;
box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}
.overlay-content {
position: relative;
top: 25%;
width: 100%;
text-align: center;
margin-top: 30px;
}
.overlay a {
padding: 8px;
text-decoration: none;
font-size: 36px;
color: #eee;
display: block;
transition: 0.3s;
}
.overlay-content a:after {
content: '';
display: block;
position: absolute;
left: 50%;
top: 50%;
width: 1000px;
height: 1000px;
margin-left: -500px;
margin-top: -500px;
background: #eee;
border-radius: 100%;
opacity: 1;
transform: scale(0);
}
.overlay .closebtn {
position: absolute;
top: 20px;
right: 45px;
font-size: 60px;
}
.overlay-content a:not(:active):after {
animation: ripple 1s ease-out infinite;
}
.overlay-content a:after {
visibility: hidden;
}
.overlay-content a:focus:after {
visibility: visible;
}
.act{
background: #eee;
}
#media only screen and (max-width: 945px){
.nav{
background: #08f;
}
.nav #a{
display: none;
}
#logo{
margin-left: 10%;
}
#logo a{
padding-right: 0;
}
}
#media only screen and (min-width: 945px){
#btn{
display: none;
}
}
</style>
<script type="text/javascript">
function openNav() {
document.getElementById("myNav").style.width = "65%";
}
function closeNav() {
document.getElementById("myNav").style.width = "0%";
}
</script>
</head>
<body>
<!Submenu>
<ul class="nav">
<li class="logo" style="padding:0;float: left;" title="Open Menu" id="btn" onclick="openNav()"><a><font color="#eee">☰</font></a></li>
<li style="float: left;" id="logo" class="logo"><a title="Shivam"><font color="#eee" size="40px">Shivam</font></a><li id="a" style="float: left;" class="sm"></li></li>
<li id="a"><a> </a></li><li id="a"><a> </a></li><li id="a"><a> </a></li>
<li id="a"><a title="Contact With Shivam" href="contact.html">Contact</a></li>
<li id="a"><a title="About Shivam" href="about.html">About Me</a></li>
<li id="a"><a title=" Shivam's Works" href="works.html">My Works</a></li>
<li id="a"><a title="Homepage"class="actv">Home</a></li>
</ul>
<div id="myNav" class="overlay">
<a title="Close Menu" href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<div class="overlay-content">
<a title="Home" class="act"><font color="#08f">Home</font></a><hr>
<a title="Works" href="works.html">Works</a><hr>
<a title="About" href="about.html">About</a><hr>
<a title="Contact" href="contact.html">Contact</a>
</div>
</div>
</body>
u forgot the name in the view port link past this in your header
<meta name="viewport" content="width=device-width,initial-scale=1.0">
I cannot seem to get the header to center once you stretch the page more than 1100 pixels and max-width is exceeded.
How can I keep the header centered?
$(document).ready(function() {
var scroll_pos = 0;
$(document).scroll(function() {
scroll_pos = $(this).scrollTop();
if (scroll_pos > 580) {
$(".normalmenuitem").css('color', '#a9a9a9');
$(".normalmenuitem").css('padding-left', '13px');
$(".normalmenuitem").css('padding-right', '13px');
} else {
$(".normalmenuitem").css('color', '#5f666f');
$(".normalmenuitem").css('padding-left', '17px');
$(".normalmenuitem").css('padding-right', '17px');
}
});
});
#media screen and (max-width: 960px) {
.normalmenuitem {
display: none;
}
}
.box {
background-color: #fff;
position: absolute;
height: 59px;
width: 100%;
top: 0;
}
.navigationmenu {
position: fixed;
width: 100%;
max-width: 1100px;
z-index: 1000;
}
#logo {
transform: translateY(-50%);
position: absolute;
top: 29px;
left: 25px;
width: 145px;
}
/* top right menu! */
.holderrr {
position: absolute;
top: 10px;
right: 0px;
}
.rightmenu {
display: inline-block;
text-decoration: none;
text-align: center;
font-family: nunito-semibold;
font-size: 15px;
padding: 6px 17px 6px 17px;
}
.normalmenuitem {
padding: 6px 17px 6px 17px;
text-decoration: none;
color: #5f666f;
transition: .3s color;
transition: .3s padding;
}
.normalmenuitem:hover {
color: #292f36 !important;
padding-left: 20px;
padding-right: 20px;
}
#trial {
transition: .3s padding;
color: #e16065;
}
#trial:hover {
color: #d64f54;
padding-left: 20px;
padding-right: 20px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="div">
<div class="navigationmenu">
<div class="box"></div>
<div class="nav">
<a href="http://braemo.com">
<img id='logo' src="http://images8.webydo.com/92/9273203/3958%2fDCD54DB5-C492-02BA-64C8-6590FD8C816C.png">
</a>
</div>
<div class="holderrr">
<div class="rightmenu">
<a class="normalmenuitem" href='#'>Features</a>
<a class="normalmenuitem" href='#'>Pricing</a>
<a class="normalmenuitem" href='#'>Blog</a>
<a class="normalmenuitem" href='#'>Support</a>
<a class="normalmenuitem" href='#'>Log In</a>
<a class="rightmenu" id="trial" href='#'>Start Free Trial</a>
</div>
</div>
</div>
</div>
Add left, right, and margin properties to .navigationmenu as such:
.navigationmenu {
position: fixed;
width: 100%;
max-width: 1100px;
z-index: 1000;
/* Add these below */
left: 0;
right: 0;
margin: auto;
}
#sidebar {
width: 160px;
z-index: 1000;
background: #ed1b2e;
position: absolute;
top: 57px;
left: 0;
}
#sidebar .inner {
border-bottom: 1px solid #f35765;
padding: 0px 0;
}
#sidebar .list {
padding: 20px 0 15px;
}
#sidebar .list li {
padding: 4px 0;
}
#sidebar .list a {
display: block;
padding: 0 10px 0 20px;
color: #ffffff;
height: 30px;
line-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#sidebar .list a:hover {
color: #ffffff;
color: rgba(255, 255, 255, 0.9);
}
#sidebar .list a.active {
background: #000810;
position: relative;
}
#sidebar .list a.active:hover {
background-color: #000810;
background-color: rgba(0, 8, 16, 0.9);
}
#sidebar .list a.active:after {
content: "";
position: absolute;
pointer-events: none;
display: block;
top: 0;
right: -30px;
height: 0;
width: 0;
border: solid transparent;
border-color: transparent;
border-left-color: #000810;
border-width: 15px;
}
<div id="sidebar" style="min-height: 1586px;">
<div class="sidebar-wrap">
<div class="sidebar-content">
<div class="inner">
<ul id="MAIN_TAB_2000_SUBMENU_TOP" class="list" style="">
<li>
<a id="2020" href="/service/main.do" class="active">Home</a>
</li>
<li>
<a id="2022" href="/service/sales/documents/issues.do">Document issues</a>
</li>
</ul>
</div>
</div>
<!-- //sidebar-content -->
</div>
<!-- //sidebar-wrap -->
</div>
If user in Chrome changes Zoom to for example 90% then Black arrow separates into two pieces. I want black arrow to be always look like when it is on 100%. I want black arrow to be always look like when it is on 100%. Any suggestions? jsfiddle
You can avoid this problem by positioning your arrow using left: 100%; instead of right: -30px;.
Remove right: -30px; from #sidebar .list a.active:after
Add left: 100%; to #sidebar .list a.active:after
My best guess as to why this is happening is that this is probably due to the way the browser is rounding pixel values.
#sidebar {
width: 160px;
z-index: 1000;
background: #ed1b2e;
position: absolute;
top: 57px;
left: 0;
}
#sidebar .inner {
border-bottom: 1px solid #f35765;
padding: 0px 0;
}
#sidebar .inner.inner-top {
padding-top: 40px;
}
#sidebar .inner.no-border {
border-bottom: none;
}
#sidebar .selector-holder {
padding: 25px 18px 28px 18px;
}
#sidebar .selector {
position: relative;
z-index: 1;
}
#sidebar .selector .toggler {
display: block;
outline: 0;
height: 28px;
background: #cc1626;
padding: 0 25px 0 10px;
overflow: hidden;
position: relative;
color: #ffffff;
font-size: 12px;
line-height: 28px;
}
#sidebar .selector .toggler span {
display: block;
white-space: nowrap;
overflow: hidden;
}
#sidebar .selector .toggler:after {
top: 50%;
right: 8px;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
margin-top: -2px;
border: solid transparent;
border-color: rgba(255, 255, 255, 0);
border-top-color: #ffffff;
border-width: 6px;
margin-left: -6px;
}
#sidebar .selector .toggler.hidden:after {
display: none;
}
#sidebar .selector ul {
padding: 3px 0;
}
#sidebar .selector ul li {
padding: 2px 0;
}
#sidebar .selector ul a {
display: block;
padding: 5px 10px;
white-space: nowrap;
color: #ffffff;
outline: 0;
font-size: 12px;
}
#sidebar .selector ul a:hover,
#sidebar .selector ul a.active {
background: #9c9c9c;
}
#sidebar .js-dropdown-content {
min-width: 100%;
background: #808080;
}
#sidebar .list {
padding: 20px 0 15px;
}
#sidebar .list li {
padding: 4px 0;
}
#sidebar .list a {
display: block;
padding: 0 10px 0 20px;
color: #ffffff;
height: 30px;
line-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#sidebar .list a:hover {
color: #ffffff;
color: rgba(255, 255, 255, 0.9);
}
#sidebar .list a.active {
background: #000810;
position: relative;
}
#sidebar .list a.active:hover {
background-color: #000810;
background-color: rgba(0, 8, 16, 0.9);
}
#sidebar .list a.active:after {
content: "";
position: absolute;
pointer-events: none;
display: block;
top: 0;
left: 100%;
height: 0;
width: 0;
border: solid transparent;
border-color: transparent;
border-left-color: #000810;
border-width: 15px;
}
<div id="sidebar" style="min-height: 1586px;">
<div class="sidebar-wrap">
<div class="sidebar-content">
<div class="inner">
<ul id="MAIN_TAB_2000_SUBMENU_TOP" class="list" style="">
<li>
<a id="2020" href="/service/main.do" class="active">Home</a>
</li>
<li>
<a id="2022" href="/service/sales/documents/issues.do">Document issues</a>
</li>
</ul>
</div>
</div>
<!-- //sidebar-content -->
</div>
<!-- //sidebar-wrap -->
</div>
Why do you want to see you page in 90% zoom. try to code your web page in 100%.
it is obvious when you zoom your page the pixel will distort.