I've used overflow: hidden to make my layout fluid. Please see (following code) the top right button named Dropdown Menu. This is what needs to be fixed.
Please see the following code for reference.
* {
padding: 0;
margin: 0;
}
*:focus {
outline: 0;
}
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
a {
text-decoration: none;
color: inherit;
}
body {
font: 14px/18px Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.float-left {
float: left;
}
.float-right {
float: right;
}
.dropdown-box {
position: relative;
}
.dropdown-box:hover .dropdown-menu {
display: block;
}
.dropdown-menu {
display: none;
position: absolute;
top: 100%;
left: 0;
}
.overlay-block {
display: none;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
position: absolute;
top: 0;
left: 0;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
transition: all 0.2s;
}
.position-center {
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
position: absolute;
top: 50%;
left: 50%;
}
.profile-header {
display: block;
}
.profile-cover {
height: 100px;
background-color: rgba(0, 0, 0, 0.5);
}
.profile-header-content {
padding-bottom: 15px;
margin-top: -72px;
position: relative;
}
.profile-header-content:after {
content: '';
clear: both;
display: block;
}
.profile-user-image,
.profile-user-video {
width: 140px;
height: 140px;
background-color: rgba(234, 234, 234, 0.5);
color: #fff;
padding: 5px;
margin: 0 15px;
overflow: hidden;
position: relative;
}
.profile-user-image:hover .overlay-block,
.profile-user-video:hover .overlay-block {
display: block;
}
.profile-user-image:active .overlay-block,
.profile-user-video:active .overlay-block {
background: rgba(0, 0, 0, 0.95);
}
.profile-user-image img,
.profile-user-video img {
display: block;
width: 100%;
}
.profile-center-content {
overflow-x: hidden;
overflow-y: visible !important;
}
<div class="profile-header">
<div class="profile-cover"> </div>
<div class="profile-header-content">
<a class="profile-user-image float-left" href="javascript:;">
<div class="overlay-block">
<div class="position-center">Overlay</div>
</div>
</a>
<a class="profile-user-video float-right" href="javascript:;">
<div class="overlay-block">
<div class="position-center">Overlay</div>
</div>
</a>
<div class="profile-center-content">
<div class="float-left">
Lorem Ipsum
</div>
<div class="float-right">
<div class="dropdown-box">
Dropdown Menu
<ul class="dropdown-menu">
<li>Home
</li>
<li>About
</li>
<li>Services
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
when you are using position: absolute; the element goes out of the scope. so remove it from .dropdown-menu so it stay's in the scope of profile-center-content and not considered out of it so it get's scrolled.
* {
padding: 0;
margin: 0;
}
*:focus {
outline: 0;
}
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
a {
text-decoration: none;
color: inherit;
}
body {
font: 14px/18px Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.float-left {
float: left;
}
.float-right {
float: right;
}
.dropdown-box {
position: relative;
}
.dropdown-box:hover .dropdown-menu {
display: block;
}
.dropdown-menu {
display: none;
}
.overlay-block {
display: none;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
position: absolute;
top: 0;
left: 0;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
transition: all 0.2s;
}
.position-center {
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
position: absolute;
top: 50%;
left: 50%;
}
.profile-header {
display: block;
}
.profile-cover {
height: 100px;
background-color: rgba(0, 0, 0, 0.5);
}
.profile-header-content {
padding-bottom: 15px;
margin-top: -72px;
position: relative;
}
.profile-header-content:after {
content: '';
clear: both;
display: block;
}
.profile-user-image,
.profile-user-video {
width: 140px;
height: 140px;
background-color: rgba(234, 234, 234, 0.5);
color: #fff;
padding: 5px;
margin: 0 15px;
overflow: hidden;
position: relative;
}
.profile-user-image:hover .overlay-block,
.profile-user-video:hover .overlay-block {
display: block;
}
.profile-user-image:active .overlay-block,
.profile-user-video:active .overlay-block {
background: rgba(0, 0, 0, 0.95);
}
.profile-user-image img,
.profile-user-video img {
display: block;
width: 100%;
}
.profile-center-content {
overflow-x: hidden;
overflow-y: visible !important;
}
<div class="profile-header">
<div class="profile-cover"> </div>
<div class="profile-header-content">
<a class="profile-user-image float-left" href="javascript:;">
<div class="overlay-block">
<div class="position-center">Overlay</div>
</div>
</a>
<a class="profile-user-video float-right" href="javascript:;">
<div class="overlay-block">
<div class="position-center">Overlay</div>
</div>
</a>
<div class="profile-center-content">
<div class="float-left">
Lorem Ipsum
</div>
<div class="float-right">
<div class="dropdown-box">
Dropdown Menu
<ul class="dropdown-menu">
<li>Home
</li>
<li>About
</li>
<li>Services
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
Related
How can I create cubic menu like this image: (When I hover on menu item)
ul li {
border-left: 1px solid #515151;
text-align: center;
padding: 4px 1rem;
font-size: 0.625rem;
}
ul {
display: flex;
padding: 0;
list-style: none;
border: 0 solid #515151;
border-width: 1px 1px 1px 0;
width: 275px;
}
<ul>
<li>Home</li>
<li>About Us</li>
<li>Products</li>
<li>Contact Us</li>
</ul>
This was my prototype for the 3d box
I then applied the prototype to your menu. What I like least is the need to set a default size. You can find in the comments where to set the height (the variabler --height) and width (--width) of the individual menu items or the height of the extrusion (--extrude).
body {
margin: 100px;
transform: translate3d(0,0,0);
transform-style: flat;
}
ul {
display: flex;
padding: 0;
list-style: none;
width: 275px;
--extrude: 0px;
--height: 35px; /* Your menu height */
}
ul li {
position: relative;
font-size: 16px;
}
.home {
--width: 75px; /* Your static width */
z-index: 1000;
}
.aboutus {
--width: 85px; /* Your static width */
z-index: 999;
}
.products {
--width: 85px; /* Your static width */
z-index: 998;
}
.contactus {
--width: 100px; /* Your static width */
z-index: 997;
}
.wrap {
position: relative;
width: var(--width);
height: var(--height);
background-color: #cccccc;
border: solid 1px #000000;
perspective: 1000px;
perspective-origin: -200px 300px;
}
.wrap * {
box-sizing: border-box;
border: none;
transition: all 0.25s;
}
.front {
position: absolute;
width: 100%;
height: 100%;
text-align: center;
line-height: var(--height);
background-color: #ffffff;
color:#000000;
transform-origin: 50% 50%;
transform: translateZ(var(--extrude));
}
ul li:hover {
--extrude: 30px; /* Your extrude height */
}
ul li:hover .front {
background-color: #f7a62f;
color:#ffffff;
}
ul li:hover .front,
ul li:hover .bottom,
ul li:hover .left {
border: solid 1px #000000;
}
.bottom {
position: absolute;
width: 100%;
height: var(--extrude);
background-color: #a3a3a3;
transform-origin: 50% 100%;
transform: translateY(calc(var(--height) - var(--extrude))) rotateX(270deg);
}
.left {
width: var(--extrude);
height: 100%;
background-color: #ffffff;
transform-origin: 0% 50%;
transform: translateZ(var(--extrude)) rotateY(90deg);
}
<ul>
<li>
<div class="wrap home">
<div class="front">
home
</div>
<div class="bottom"></div>
<div class="left"></div>
</div>
</li>
<li>
<div class="wrap aboutus">
<div class="front">
About Us
</div>
<div class="bottom"></div>
<div class="left"></div>
</div>
</li>
<li>
<div class="wrap products">
<div class="front">
Products
</div>
<div class="bottom"></div>
<div class="left"></div>
</div>
</li>
<li>
<div class="wrap contactus">
<div class="front">
Contact Us
</div>
<div class="bottom"></div>
<div class="left"></div>
</div>
</li>
</ul>
Try this example,it uses combination of :before&:after,(I know there is some lag)
*,
*:before,
*:after {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
transform: translate3d(0, 0, 0);
}
.clearfix {
zoom: 1;
}
.clearfix:before, .clearfix:after {
content: " ";
display: block;
height: 0;
overflow: hidden;
}
.clearfix:after {
clear: both;
}
body {
background: #f2f2f2;
}
ul {
display:inline-flex;
transform: rotate(0deg) skew(0deg, 0deg);
width:100%;
}
.list-item {
background: #000;
color: #575757;
text-align: center;
height: 2.5em;
width: 4em;
vertical-align: middle;
line-height: 2.5em;
border-bottom: 1px solid #060606;
position: relative;
display: inline-block;
text-decoration: none;
transition: all 0.25s linear;
}
.list-item:hover {
background: #ff6e42;
color: #fffcfb;
transform: translate(0.9em, -0.9em);
transition: all 0.25s linear;
}
.list-item:hover{
z-index:100;
}
.list-item:hover:before, .list-item:hover:after {
transition: all 0.25s linear;
}
.list-item:hover:before {
background: #b65234;
width: 1em;
top: 0.5em;
left: -1em;
}
.list-item:hover:after {
background: #b65234;
width: 1em;
bottom: -2.5em;
left: 1em;
height: 4em;
}
.list-item:before, .list-item:after {
content: "";
position: absolute;
transition: all 0.25s linear;
width: 0.5em;
}
.list-item:after {
height: 4em;
background: #000;
bottom: -2.25em;
left: 1.5em;
transform: rotate(90deg) skew(0, 45deg);
}
.list-item:before {
height: 2.5em;
background: #000;
top: 0.25em;
left: -0.5em;
transform: skewY(-45deg);
}
<ul>
<li>
<a class='list-item' href=''>
hi
</a>
</li>
<li>
<a class='list-item' href=''>
hello
</a>
</li>
<li>
<a class='list-item' href=''>
i am a
</a>
</li>
<li>
<a class='list-item' href=''>
menu
</a>
</li>
<li>
<a class='list-item' href=''>
item
</a>
</li>
</ul>
I am trying to use HTML and CSS instead of images to show some arrows -- Here is the image:
I'm trying to make these arrows with before and after pseudo-elements, but I have got problems.
Here's my code:
HTML:
<ul class="steps-list">
<li class="step-item">
Contact us
</li>
<li class="step-item">
Consult with RCIC
</li>
<li class="step-item">
Apply via your pathway
</li>
<li class="step-item">
Settle in Canada
</li>
</ul>
SASS:
.steps-list {
display: flex;
.step-item {
display: inline-block;
text-align: center;
width: 25%;
.step-link {
font-weight: bold;
background: #e2e3e4;
width: 100%;
display: inline-block;
padding: 2rem 1rem;
&:hover {
#include gradient(left, $gradientList2);
}
}
}
}
I have followed this article by the way:
https://css-tricks.com/snippets/css/css-triangle/
[Edit] After looking at your image again, I failed to account for the first element being flat. I have updated my answer.
Using before,after, and nth-child selectors, you can achieve what you showed in your image. The before and after pseudo elements are used to create the top and bottom half of the arrows while the nth-child selectors are used to make the arrows appear to be progressively closer together.
.steps-list {
display: flex;
list-style: none;
}
.steps-list .step-item {
position: relative;
display: flex;
align-items:center;
text-align: center;
width: 25%;
}
.steps-list .step-item .step-link {
font-weight: bold;
width: 100%;
display: inline-block;
padding:10px 5px;
box-sizing:border-box;
}
.step-link::before {
content: "";
display: block;
position: absolute;
transform: skew(-40deg, 0);
background: #e2e3e4;
height: 50%;
bottom: 0;
z-index: -1;
left:5px;
}
.step-link::after {
content: "";
display: block;
position: absolute;
transform: skew(40deg, 0);
background: #e2e3e4;
height: 50%;
top: 0;
z-index: -1;
left:5px;
}
.step-item:nth-child(1){
overflow:hidden;
}
.step-item:nth-child(1) .step-link::after {
width:95%;
left:-15px;
}
.step-item:nth-child(1) .step-link::before {
width: 95%;
left:-15px;
}
.step-item:nth-child(2) .step-link::after {
width: 90%;
}
.step-item:nth-child(2) .step-link::before {
width: 90%;
}
.step-item:nth-child(3) .step-link::after {
width: 95%;
}
.step-item:nth-child(3) .step-link::before {
width: 95%;
}
.step-item:nth-child(4) .step-link::after {
width: 100%;
}
.step-item:nth-child(4) .step-link::before {
width: 100%;
}
<ul class="steps-list">
<li class="step-item">
Contact us
</li>
<li class="step-item">
Consult with RCIC
</li>
<li class="step-item">
Apply via your pathway
</li>
<li class="step-item">
Settle in Canada
</li>
</ul>
Check this site
.clearfix:after {
clear: both;
content: "";
display: block;
height: 0;
}
.container {
font-family: 'Lato', sans-serif;
width: 1000px;
margin: 0 auto;
}
.wrapper {
display: table-cell;
height: 400px;
vertical-align: middle;
}
.nav {
margin-top: 40px;
}
.arrow-steps .step {
font-size: 14px;
text-align: center;
color: #666;
cursor: default;
margin: 0 3px;
padding: 10px 10px 10px 30px;
min-width: 180px;
float: left;
position: relative;
background-color: #d9e3f7;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
transition: background-color 0.2s ease;
}
.arrow-steps .step:after,
.arrow-steps .step:before {
content: " ";
position: absolute;
top: 0;
right: -17px;
width: 0;
height: 0;
border-top: 19px solid transparent;
border-bottom: 17px solid transparent;
border-left: 17px solid #d9e3f7;
z-index: 2;
transition: border-color 0.2s ease;
}
.arrow-steps .step:before {
right: auto;
left: 0;
border-left: 17px solid #fff;
z-index: 0;
}
.arrow-steps .step:first-child:before {
border: none;
}
.arrow-steps .step:first-child {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.arrow-steps .step span {
position: relative;
}
<div class="container">
<div class="wrapper">
<div class="arrow-steps clearfix">
<div class="step current"> <span> Step 1</span> </div>
<div class="step"> <span>Step 2 some words</span> </div>
<div class="step"> <span> Step 3</span> </div>
<div class="step"> <span>Step 4</span> </div>
</div>
</div>
</div>
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;
}
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;
}
Okey, I'm working on a project and run in to a smal problem. I have a list that have text with an underline animation but now I want to include an img in the list. So i want to hover both the img and the text and the animation will only aply to the text. I have tried with a p element but didnt really work.
This is what I have at the moment:
/*Not imortant*/
.wrapper {
background-color: white;
color: white;
height: 500px;
margin: auto;
margin-top: 50px;
max-width: 1024px;
padding: 20px;
text-shadow: 1px 1px 1px #333;
width: 65%;
}
.wrapper h2 {
font-size: 44px;
margin: 0;
}
.wrapper p {
font-size: 25px;
font-weight: 500;
}
/*Here the important stuff happens*/
.wrapper li {
text-align: center;
}
.wrapper a img {
width: 100%;
height: 100px;
}
.wrapper a p {
color: white;
display: inline-block;
font-size: 25px;
font-weight: 500;
position: relative;
margin: 0;
}
.wrapper a p:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: white;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.wrapper a p:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.main {
background-color: rgba(51, 51, 51, 0.3);
}
<main class="wrapper main">
<div class="row--no-gutter">
<h2>Gnestarias</h2>
<p>Some text :)</p>
</div>
<div class="row--no-gutter">
<ul>
<li class="col col--1-of-5">
<a href="arena.html">
<p>Arena</p>
<img src="#" alt="bild">
</a>
</li>
<li class="col col--1-of-5">
<a href="athena.html">
<p>Athena</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="eatmeat.html">
<p>Eatmeat</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="georges.html">
<p>Georges</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="vitavillan.html">
<p>Vitavillan</p>
</a>
</li>
</ul>
</div>
</main>
Note that there is an grid behind it also (toast grid to be spesific) :)
Can i do something with only css or do I have to fix it with Javascript?
I want to be able to hover both the img and the text and the animation should only apply on the text, nothing else, and the underline should stop when the text stops
Hope you can help :)
http://johhag98.github.io/Gnesta-Pizza/
Move the hover trigger to the wrapping anchor
.wrapper a:hover p:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
/*Not imortant*/
.wrapper {
background-color: white;
color: white;
height: 500px;
margin: auto;
margin-top: 50px;
max-width: 1024px;
padding: 20px;
text-shadow: 1px 1px 1px #333;
width: 65%;
}
.wrapper h2 {
font-size: 44px;
margin: 0;
}
.wrapper p {
font-size: 25px;
font-weight: 500;
}
/*Here the important stuff happens*/
.wrapper li {
text-align: center;
list-style: none;
}
.wrapper a {
display: block;
}
.wrapper a img {
max-width: 100%;
height: 100px;
}
.wrapper a p {
color: white;
display: inline-block;
font-size: 25px;
font-weight: 500;
position: relative;
margin: 0;
}
.wrapper a p:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: white;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.wrapper a:hover p:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.main {
background-color: rgba(51, 51, 51, 0.3);
}
<main class="wrapper main">
<div class="row--no-gutter">
<h2>Gnestarias</h2>
<p>Some text :)</p>
</div>
<div class="row--no-gutter">
<ul>
<li class="col col--1-of-5">
<a href="arena.html">
<p>Arena</p>
<img src="http://www.fillmurray.com/100/100" alt="bild">
</a>
</li>
</ul>
</div>
</main>
Why don't you trigger the animation on hovering on the parent anchor tag?
Like this:
.wrapper a:hover p:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
Demo here:
/*Not imortant*/
.wrapper {
background-color: white;
color: white;
height: 500px;
margin: auto;
margin-top: 50px;
max-width: 1024px;
padding: 20px;
text-shadow: 1px 1px 1px #333;
width: 65%;
}
.wrapper h2 {
font-size: 44px;
margin: 0;
}
.wrapper p {
font-size: 25px;
font-weight: 500;
}
/*Here the important stuff happens*/
.wrapper li {
text-align: center;
}
.wrapper a img {
width: 100%;
height: 100px;
}
.wrapper a p {
color: white;
display: inline-block;
font-size: 25px;
font-weight: 500;
position: relative;
margin: 0;
}
.wrapper a p:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: white;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.wrapper a p:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.wrapper a:hover p:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.main {
background-color: rgba(51, 51, 51, 0.3);
}
<main class="wrapper main">
<div class="row--no-gutter">
<h2>Gnestarias</h2>
<p>Some text :)</p>
</div>
<div class="row--no-gutter">
<ul>
<li class="col col--1-of-5">
<a href="arena.html">
<p>Arena</p>
<img src="#" alt="bild">
</a>
</li>
<li class="col col--1-of-5">
<a href="athena.html">
<p>Athena</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="eatmeat.html">
<p>Eatmeat</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="georges.html">
<p>Georges</p>
</a>
</li>
<li class="col col--1-of-5">
<a href="vitavillan.html">
<p>Vitavillan</p>
</a>
</li>
</ul>
</div>
</main>