I made several changes to a navigation bar that I had. Since the changes, I cannot get the red "Request Quote" button to vertically align in the middle to line up with the other items in the nav.
What I changed was wrapping the link around the list item so that the whole space would be clickable for the mobile version. Previously, the html was like:
<li>LEARN</li>
and I would use #nav-list li a to call the elements because I didn't assign a class at that point.
Does anyone see what I am doing wrong? I do not want to use position: absolute if possible.
nav {
background: #FFF;
height: 70px;
width: 100%;
max-width: 100%;
box-shadow: 0px 6px 15px -4px rgba(0,0,0,0.12);
position: fixed;
top: 0;
z-index: 999;
box-sizing: border-box;
}
#nav-pop {
float: right;
display: block;
margin-right: 5%;
margin-top: 25px;
transition: ease 0.5s;-webkit-transition: ease 0.5s;
}
#nav-pop.active {
opacity: 1;
background: rgba(0,0,0,0.8);
background: #2f2f2f;
right: 0;
margin-top: 0;
margin-right: 0;
z-index: 999999;
transition: ease 0.6s;-webkit-transition: ease 0.6s;
transform: translateX(0);-webkit-transform: translateX(0);
box-shadow: -9px 0px 9px 1px rgba(0,0,0,.2);
}
.navItem {
display: inline-block;
margin: 0 17px;
vertical-align: top;
}
.navItem:first-child {
margin-left: 0px;
}
.navItem:last-child {
margin-right: 0px;
}
.navItem, #serviceClick {
text-decoration: none;
font-family: 'Muli', sans-serif;
font-size: .9rem;
color: #747678;
letter-spacing: 1px;
vertical-align: top;
transition: all .3s;-webkit-transition: all .3s;
cursor: pointer;
}
.navItem:after, #serviceClick:after {
content: '';
display: block;
width: 0;
margin-top: 6px;
background: #b82222;
height: 2px;
transition: width .3s;
}
.navItem:hover, #serviceClick:hover {
color: #4b4b4b;
transition: all .3s;-webkit-transition: all .3s;
}
.navItem:hover:after, #serviceClick:hover:after {
width: 100%;
transition: width .3s;
}
.navInverse {
padding: 10px 12px;
border-radius: 2px;
box-sizing: border-box;
font-family: 'Muli', sans-serif;
font-size: 1.2rem;
color: #FFF;
border: 1px solid #b82222;
background: linear-gradient(to right bottom, #b82222, #a51e1e);
text-transform: uppercase;
text-decoration: none;
cursor: pointer;
}
.navInverse:hover {
background: #b82222;
background: #FFF;
color: #b82222;
}
.navInverse:after {
content: '';
display: none;
width: 0px;
height: 0px;
transition: none;
}
<nav>
<div id="nav-pop">
<ul id="nav-list">
<li>ABOUT</li>
<li id="serviceClick" class="navItem">SOLUTIONS</li>
<li>LEARN</li>
<li>CONTACT</li>
<li>REQUEST QUOTE</li>
</ul>
</div>
</nav>
A revised answer of my previous explantaion, just remove the margin-top in nav-pop and the add:
#nav-list {
display: flex;
align-items: center;
}
See snippet for finished output:
nav {
background: #FFF;
height: 70px;
width: 100%;
max-width: 100%;
box-shadow: 0px 6px 15px -4px rgba(0,0,0,0.12);
position: fixed;
top: 0;
z-index: 999;
box-sizing: border-box;
}
#nav-list {
display: flex;
align-items: center;
}
#nav-pop {
float: right;
display: block;
margin-right: 5%;
margin-top: 15px;
transition: ease 0.5s;-webkit-transition: ease 0.5s;
}
#nav-pop.active {
opacity: 1;
background: rgba(0,0,0,0.8);
background: #2f2f2f;
right: 0;
margin-top: 0;
margin-right: 0;
z-index: 999999;
transition: ease 0.6s;-webkit-transition: ease 0.6s;
transform: translateX(0);-webkit-transform: translateX(0);
box-shadow: -9px 0px 9px 1px rgba(0,0,0,.2);
}
.navItem {
display: inline-block;
margin: 0 17px;
vertical-align: top;
}
.navItem:first-child {
margin-left: 0px;
}
.navItem:last-child {
margin-right: 0px;
}
.navItem, #serviceClick {
text-decoration: none;
font-family: 'Muli', sans-serif;
font-size: .9rem;
color: #747678;
letter-spacing: 1px;
vertical-align: top;
transition: all .3s;-webkit-transition: all .3s;
cursor: pointer;
}
.navItem:after, #serviceClick:after {
content: '';
display: block;
width: 0;
margin-top: 6px;
background: #b82222;
height: 2px;
transition: width .3s;
}
.navItem:hover, #serviceClick:hover {
color: #4b4b4b;
transition: all .3s;-webkit-transition: all .3s;
}
.navItem:hover:after, #serviceClick:hover:after {
width: 100%;
transition: width .3s;
}
.navInverse {
padding: 10px 12px;
border-radius: 2px;
box-sizing: border-box;
font-family: 'Muli', sans-serif;
font-size: 1.2rem;
color: #FFF;
border: 1px solid #b82222;
background: linear-gradient(to right bottom, #b82222, #a51e1e);
text-transform: uppercase;
text-decoration: none;
cursor: pointer;
}
.navInverse:hover {
background: #b82222;
background: #FFF;
color: #b82222;
}
.navInverse:after {
content: '';
display: none;
width: 0px;
height: 0px;
transition: none;
}
<nav>
<div id="nav-pop">
<ul id="nav-list">
<li>ABOUT</li>
<li id="serviceClick" class="navItem">SOLUTIONS</li>
<li>LEARN</li>
<li>CONTACT</li>
<li>REQUEST QUOTE</li>
</ul>
</div>
</nav>
Firstly, Keep li as child of ul not anchor.
Removed the top margin on nav-pop.
Added display: flex and align-items: center on nav-list.
Reduced the after element's margin to zero.
nav {
background: #FFF;
height: 70px;
width: 100%;
max-width: 100%;
box-shadow: 0px 6px 15px -4px rgba(0, 0, 0, 0.12);
position: fixed;
top: 0;
z-index: 999;
box-sizing: border-box;
}
#nav-pop {
float: right;
display: block;
margin-right: 5%;
transition: ease 0.5s;
-webkit-transition: ease 0.5s;
}
#nav-pop.active {
opacity: 1;
background: rgba(0, 0, 0, 0.8);
background: #2f2f2f;
right: 0;
margin-top: 0;
margin-right: 0;
z-index: 999999;
transition: ease 0.6s;
-webkit-transition: ease 0.6s;
transform: translateX(0);
-webkit-transform: translateX(0);
box-shadow: -9px 0px 9px 1px rgba(0, 0, 0, .2);
}
.navItem {
display: inline-block;
margin: 0 17px;
vertical-align: top;
}
.navItem:first-child {
margin-left: 0px;
}
.navItem:last-child {
margin-right: 0px;
}
.navItem,
#serviceClick {
text-decoration: none;
font-family: 'Muli', sans-serif;
font-size: .9rem;
color: #747678;
letter-spacing: 1px;
vertical-align: top;
transition: all .3s;
-webkit-transition: all .3s;
cursor: pointer;
}
.navItem:after,
#serviceClick:after {
content: '';
display: block;
width: 0;
margin-top: 0px;
background: #b82222;
height: 2px;
transition: width .3s;
}
.navItem:hover,
#serviceClick:hover {
color: #4b4b4b;
transition: all .3s;
-webkit-transition: all .3s;
}
.navItem:hover:after,
#serviceClick:hover:after {
width: 100%;
transition: width .3s;
}
.navInverse {
padding: 10px 12px;
border-radius: 2px;
box-sizing: border-box;
font-family: 'Muli', sans-serif;
font-size: 1.2rem;
color: #FFF;
border: 1px solid #b82222;
background: linear-gradient(to right bottom, #b82222, #a51e1e);
text-transform: uppercase;
text-decoration: none;
cursor: pointer;
}
.navInverse:hover {
background: #b82222;
background: #FFF;
color: #b82222;
}
.navInverse:after {
content: '';
display: none;
width: 0px;
height: 0px;
transition: none;
}
#nav-list {
display: flex;
align-items: center;
}
.navItem a {
padding: 24px 12px;
}
<nav>
<div id="nav-pop">
<ul id="nav-list">
<li href="" class="navItem"><a>ABOUT</a></li>
<li id="serviceClick" class="navItem">SOLUTIONS</li>
<li href="" class="navItem"><a>LEARN</a></li>
<li href="" class="navItem"><a>CONTACT</a></li>
<li href="" class="navInverse navItem" id="quoteButton"><a>REQUEST QUOTE</a></li>
</ul>
</div>
</nav>
To get a full alignment on your navbar I removed the margin-top from the #nav-pop id it wasn't necessary. Then changed the nav-list id (because it's the container) by adding the following:
#nav-list {
display: flex;
align-items: center;
}
Giving me the desired display you're after:
The first issue I notice is that your ul #nav-list has a margin-top that may be affecting your alignment, but the most important issue is that the height of #quoteButton does not match the line-height of the rest of your links (because there is none set). This will cause vertical-align: middle to not work correctly as the elements are not the same heights.
When I set the line-height of each <li> to 44px they align perfectly. To me, the answer suggested by #billy.farroll is not sufficient as the button text does not align with the <li>s.
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 provided my CSS and HTML down below. I am trying to finish off my dropdown, but there's an issue with it that makes the transition not so smooth. It's hard to explain with words on what it's doing.
I have tried changing the display, max-height, padding, and margin but there have been no results. Perhaps I need to add some JavaScript to it rather than CSS? Any suggestions or problems that can be pointed out will be great.
#navigation {
height: 100px;
padding: 10px 3px 3px;
background-color: #FFF;
margin-bottom: 210px;
border-radius: 5px;
}
#nav-container {
display: table;
margin: 10px auto;
}
#nav-items {
list-style-type: none;
margin-left: -45px;
margin-top: -26px;
}
#nav-items li {
display: inline-block;
vertical-align: top;
width: 400px;
}
/* nav-dropdown */
#dropdown {
display: block;
position: absolute;
text-align: center;
width: 300px;
height: 50px;
}
#dropdown p {
font-family: 'Work Sans', sans-serif;
font-size: 35px;
letter-spacing: 5px;
display: table-cell;
margin: 0;
cursor: pointer;
background-color: transparent;
text-align: center;
}
#extensions {
display: table;
border-collapse: separate;
border-spacing: 40px;
height: 50px;
width: 350px;
}
.label {
font-family: 'Work Sans', sans-serif;
font-size: 35px;
letter-spacing: 5px;
text-align: center;
position: absolute;
width: 300px;
}
#dropdown-content {
position: absolute;
margin: 0 auto;
opacity: 0;
width: 300px;
height: 50px;
background-color: #C9C9C9;
border-radius: 8px;
box-shadow: 1px 1px 50px 0px white;
z-index: 1;
overflow-y: hidden;
transition-property: all;
transition-duration: 0.5s;
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
}
.nav-dropdown-container {width: 350px;height: 800px;}
#dropdown-content p {
font-size: 20px;
font-family: 'Work Sans', sans-serif;
font-size: 30px;
letter-spacing: 2px;
}
#dropdown-content:hover {
opacity: 1;
max-height: 500px;
padding-top: 1em;
padding-bottom: 1em;
margin-top: 50px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
display: block;
}
#dropdown-content:hover p {
display: block;
text-decoration: none;
transition: 0.5s;
}
#dropdown-content p {display: none;}
#dropdown-link {color: white;}
#dropdown-link:link {
color: white;
text-decoration: none;
}
#dropdown-link:hover {
color: lightgrey;
}
<nav id="navigation">
<div id="nav-container">
<ul id="nav-items">
<li>
<div id="extensions">
<div class="nav-dropdown-container">
<div id="dropdown">
<p class="label">TEST</p>
<div id="dropdown-content">
<p><a id="dropdown-link" href="hello.html">HELLO</a></p>
<p><a id="dropdown-link" href="world.html">WORLD</a></p>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
</nav>
As stated in the comments, the reason is because when the :hover state is triggered on #dropdown-content, the mouse cursor quickly enters and leaves the element causing the state to be quickly toggled on and off repeatedly, resulting in a janky transition.
The fastest fix is this: you should change your selectors so that you bind the :hover state to the nearest common ancestor of both the label AND the dropdown content, i.e. #dropdown.
So you should change this:
#dropdown-content:hover { ... }
#dropdown-content:hover p { ... }
...to this:
#dropdown:hover #dropdown-content { ... }
#dropdown:hover #dropdown-content p { ... }
This is of course a stop-gap solution since I find your markup unnecessarily bloated in order to achieve a simple dropdown effect.
#navigation {
height: 100px;
padding: 10px 3px 3px;
background-color: #FFF;
margin-bottom: 210px;
border-radius: 5px;
}
#nav-container {
display: table;
margin: 10px auto;
}
#nav-items {
list-style-type: none;
margin-left: -45px;
margin-top: -26px;
}
#nav-items li {
display: inline-block;
vertical-align: top;
width: 400px;
}
/* nav-dropdown */
#dropdown {
display: block;
position: absolute;
text-align: center;
width: 300px;
height: 50px;
}
#dropdown p {
font-family: 'Work Sans', sans-serif;
font-size: 35px;
letter-spacing: 5px;
display: table-cell;
margin: 0;
cursor: pointer;
background-color: transparent;
text-align: center;
}
#extensions {
display: table;
border-collapse: separate;
border-spacing: 40px;
height: 50px;
width: 350px;
}
.label {
font-family: 'Work Sans', sans-serif;
font-size: 35px;
letter-spacing: 5px;
text-align: center;
position: absolute;
width: 300px;
}
#dropdown-content {
position: absolute;
margin: 0 auto;
opacity: 0;
width: 300px;
height: 50px;
background-color: #C9C9C9;
border-radius: 8px;
box-shadow: 1px 1px 50px 0px white;
z-index: 1;
overflow-y: hidden;
transition-property: all;
transition-duration: 0.5s;
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
}
.nav-dropdown-container {
width: 350px;
height: 800px;
}
#dropdown-content p {
font-size: 20px;
font-family: 'Work Sans', sans-serif;
font-size: 30px;
letter-spacing: 2px;
}
#dropdown:hover #dropdown-content {
opacity: 1;
max-height: 500px;
padding-top: 1em;
padding-bottom: 1em;
margin-top: 50px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
display: block;
}
#dropdown:hover #dropdown-content p {
display: block;
text-decoration: none;
transition: 0.5s;
}
#dropdown-content p {
display: none;
}
#dropdown-link {
color: white;
}
#dropdown-link:link {
color: white;
text-decoration: none;
}
#dropdown-link:hover {
color: lightgrey;
}
<nav id="navigation">
<div id="nav-container">
<ul id="nav-items">
<li>
<div id="extensions">
<div class="nav-dropdown-container">
<div id="dropdown">
<p class="label">TEST</p>
<div id="dropdown-content">
<p><a id="dropdown-link" href="hello.html">HELLO</a></p>
<p><a id="dropdown-link" href="world.html">WORLD</a></p>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
</nav>
I am making a portal for some students but every time they resize the browser window, the CSS classes move around.
I've been stuck on this for a few days now and I think I'm spending way too much time just trying to figure this part out.
I put the code in the post and I attached the background image. Is there a certain CSS rule that will make it where the CSS classes won't move when the browser moves?
Thanks!
Here's the CSS & HTML code:
.google-container {
overflow: hidden;
bottom: 2070px;
left: 350px;
padding-top: 56.25%;
position: relative;
}
.java-container {
overflow: hidden;
padding-top: 56.25%;
position: relative;
}
.java-container iframe {
border: 0;
height: 400%;
right: 400px;
position: absolute;
top: 200px;
width: 100%;
}
.iframe-container {
overflow: hidden;
padding-top: 56.25%;
position: relative;
}
.iframe-container iframe {
border: 0;
height: 100%;
left: 1538px;
position: absolute;
top: 180px;
width: 100%;
}
.sutori {
position: absolute;
bottom: 1878px;
left: 422px;
background-color: #33afff;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
padding: 20px;
width: 240px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.sutori:hover,
.sutori:focus {
background-color: #d3d3d3;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
bottom: 1825px;
left: 260px;
background-color: #d3d3d3;
min-width: 160px;
overflow: auto;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown a:hover {
background-color: #ddd;
}
.show {
display: block;
}
.drivebutton {
position: absolute;
bottom: 510px;
left: 1190px;
background-color: #d54b3d;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.drivebutton:hover,
.drivebutton:focus {
background-color: #d3d3d3;
}
.drivebutton:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.drivebutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.drivebutton-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.drivebutton:hover,
.drivebutton:focus {
background-color: #d3d3d3;
}
.drivebutton a:hover {
background-color: #ddd;
}
.classroombutton {
position: absolute;
bottom: 385px;
left: 1190px;
background-color: #d54b3d;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.classroombutton:hover,
.classroombutton:focus {
background-color: #d3d3d3;
}
.classroombutton:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.classroombutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.classroombutton-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.classroombutton:hover,
.classroombutton:focus {
background-color: #d3d3d3;
}
.classroombutton a:hover {
background-color: #ddd;
}
.youtubebutton {
position: absolute;
bottom: 295px;
left: 1190px;
background-color: #d54b3d;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.youtubebutton:hover,
.youtubebutton:focus {
background-color: #d3d3d3;
}
.youtubebutton:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.youtubebutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.youtubebutton-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.youtubebutton:hover,
.youtubebutton:focus {
background-color: #d3d3d3;
}
.youtubebutton a:hover {
background-color: #ddd;
}
.conbutton {
position: absolute;
bottom: 512px;
left: 816px;
background-color: #daa520;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.conbutton:hover,
.mailbutton:focus {
background-color: #d3d3d3;
}
.conbutton:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.conbutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.conbutton-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.conbutton:hover,
.mailbutton:focus {
background-color: #d3d3d3;
}
.conbutton a:hover {
background-color: #ddd;
}
.mailbutton {
position: absolute;
bottom: 600px;
left: 1190px;
background-color: #d54b3d;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.mailbutton:hover,
.mailbutton:focus {
background-color: #d3d3d3;
}
.mailbutton:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.mailbutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.mailbutton-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.mailbutton:hover,
.mailbutton:focus {
background-color: #d3d3d3;
}
.mailbutton a:hover {
background-color: #ddd;
}
.button {
position: absolute;
bottom: 450px;
left: 570px;
background-color: #33afff;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.button:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.button:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.button:hover,
.button:focus {
background-color: #000000;
}
.buttonflip {
position: absolute;
bottom: 510px;
left: 430px;
background-color: #18d71f;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.buttonflip:hover,
.buttonflip:focus {
background-color: #d3d3d3;
}
.buttonflip:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.buttonflip:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.buttonflip-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.buttonflip:hover,
.buttonflip:focus {
background-color: #d3d3d3;
}
.buttonflip a:hover {
background-color: #ddd;
}
.sketchfabbutton {
position: absolute;
bottom: 295px;
left: 1190px;
background-color: #d54b3d;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.sketchfabbutton:hover,
.sketchfabbutton:focus {
background-color: #d3d3d3;
}
.sketchfabbutton:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.sketchfabbutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.sketchfabbutton-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.sketchfabbutton:hover,
.sketchfabbutton:focus {
background-color: #d3d3d3;
}
.sketchfabbutton a:hover {
background-color: #ddd;
}
.sketchbutton {
position: absolute;
bottom: 385px;
left: 430px;
background-color: #107014;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.sketchbutton:hover,
.sketchbutton:focus {
background-color: #d3d3d3;
}
.sketchbutton:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.sketchbutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.sketchbutton-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.sketchbutton:hover,
.sketchbutton:focus {
background-color: #d3d3d3;
}
.sketchbutton a:hover {
background-color: #ddd;
}
.eastbutton {
position: absolute;
bottom: 629px;
left: 816px;
background-color: #0091b2;
border: none;
font-size: 28px;
font-family: "Arial";
color: #FFFFFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
/* Safari */
transition-duration: 0.2s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
.eastbutton:hover,
.eastbutton:focus {
background-color: #d3d3d3;
}
.eastbutton:after {
content: "";
background: #000000;
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px!important;
margin-top: -120%;
opacity: 0;
transition: all 0.4s
}
.eastbutton:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
.eastbutton-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.eastbutton:hover,
.eastbutton:focus {
background-color: #d3d3d3;
}
.eastbutton a:hover {
background-color: #ddd;
}
body {
background-image: url("backtest2.png");
background-repeat: no-repeat;
background-position: right 400% bottom 101%;
background-size: 1920px 1000px;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>EAST Portal!</title>
<div class="iframe-container">
<iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2FEAST-at-Gentry-Public-Schools-405756842946474%2F&tabs=timeline&width=340&height=500&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true&appId"
width="340" height="500" style="border:none;overflow:hidden;" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>
</div>
<body scroll="no" style="overflow: hidden">
<div class="google-container" <center>
<form method="GET" action="https://www.google.com/search">
<a href="https://www.google.com/search?safe=vss">
<img src="https://www.edigitalagency.com.au/wp-content/uploads/google-logo-png-transparent-background-large-new-800x270.png" border="0" alt="Google" width="115" height="39" align="absmiddle"></a><br>
<input type="text" name="q" size="15" maxlength="255" value="" style="width:220px;height:40px;font-size:12px;border-style:solid; border-width:1px;">
<input type="submit" name="sa" value="Search" style="width:100px;height:40px;font-size:18px; padding-top:-20;"><input type="hidden" name="safe" value="strict">
</td>
</tr>
</tbody>
</table>
</form>
</center>
</div>
<style>
p {
position: fixed;
bottom: 750px;
left: 1200px;
font-size: 34px;
font-family: "Arial";
margin-top: 5px;
}
</style>
</head>
<body>
<div class="dropdown">
<button onclick="myFunction()" class="sutori">Sutori</button>
<div id="myDropdown" class="dropdown-content">
Sutori
EAST Sutori
Photography Club
</div>
</div>
</head>
<body>
Flipgrid</button>
Gmail</button>
Google Drive</button>
Google Classroom</button>
EAST</button>
Digital Nature Museum</button>
Conference Sign-up Sheet</button>
YouTube</button>
YouTube</button>
</body>
</html>
When I hover to one of the elements, that elements itself expands, and other will adjust when the font-size gets bigger. How to stop that?
Same is happening to the red background, so I set a height: 38px; to avoid expanding:
header {
position: relative;
top: 10px;
margin: 0 auto;
height: 38px;
width: 100%;
background: red;
}
Now I tried to set a height and width to a single <li> to see if it won't move/expand at all, but doesn't work:
<li style="width: 130px; height: 38px;">Home</li>
* {
margin: 0;
padding: 0;
}
body {
background: royalblue;
font-family: monospace;
}
header {
position: relative;
top: 10px;
margin: 0 auto;
height: 38px;
width: 100%;
background: red;
}
.parent-ul {
position: relative;
top: 0px;
list-style: none;
text-align: center;
padding: 11px 0;
}
.parent-ul li {
margin: -4px;
display: inline;
padding: 7px 13px;
border-left: 1px solid silver;
transition: background 1s, border 1s,
border-radius 1s;
}
#prod {
border-right: 1px solid silver;
padding-right: 15px;
}
.parent-ul a {
text-decoration: none;
color: white;
padding: 0px 50px;
font-size: 14px;
transition: color 1s, font-size .5s;
}
/* Effects ================================ */
li:hover {
background: black;
border: 0;
border-radius: 2px;
}
li:hover + li {
border: 0;
}
li:hover a {
color: gold;
font-size: 18px;
}
#prod:hover {
border: 0;
}
<body>
<header>
<ul class="parent-ul">
<li style="width: 130px; height: 38px;">Home</li>
<li>About</li>
<li>Contact</li>
<li>Services</li>
<li id="prod">Products</li>
</ul>
</header>
</body>
Yoy can use float: left and box-sizing: border-box to align the nav items. Also, use padding : 0 so that when you make the text big, it is centered. Here is an example:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: royalblue;
font-family: monospace;
}
header {
position: relative;
margin: 0 auto;
height: 38px;
width: 100%;
background: red;
}
.parent-ul {
position: relative;
list-style: none;
text-align: center;
}
.parent-ul li {
height: 38px;
width: 20%;
float: left;
transition: background 1s, border 1s,
border-radius 1s;
}
.parent-ul li:not(:first-child) {
border-left: 1px solid silver;
}
.parent-ul a {
text-decoration: none;
color: white;
padding: 0;
font-size: 14px;
transition: color 1s, font-size .5s;
line-height: 38px;
}
/* Effects ================================ */
li:hover {
background: black;
border: 0;
border-radius: 2px;
cursor: pointer;
}
li:hover a {
color: gold;
font-size: 18px;
}
<body>
<header>
<ul class="parent-ul">
<li>Home</li>
<li>About</li>
<li>Contact</li>
<li>Services</li>
<li>Products</li>
</ul>
</header>
</body>
You need to set its display property so that it accepts height and width of the element.
Try this
<li style="display:inline-block;width: 130px; height: 38px;">Home</li>
I give it a try with a different approach. Instead of changing the fontsize, you could scale the text (which is wrapped with <span></span> tag). Take a look at this https://jsbin.com/fekihusasi/edit?html,css,output.
You can use, Transform: scale(1.3 , 1.3); for the text when you hover on it.
take a look at this: https://plnkr.co/edit/JG3Y1PmLJK2hiL8JNGSy
CSS:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: royalblue;
font-family: monospace;
}
header {
position: relative;
margin: 0 auto;
height: 38px;
width: 100%;
background: red;
}
.parent-ul {
list-style: none;
text-align: center;
}
.parent-ul li {
width: 18%;
display: inline-block;
transition: background 1s, border 1s, border-radius 1s;
}
.parent-ul a {
text-decoration: none;
color: white;
padding: 0;
font-size: 14px;
transition: all .3s linear;
line-height: 38px;
}
/* Effects ================================ */
li:hover {
background: black;
border: 0;
border-radius: 2px;
cursor: pointer;
transition: all .3s linear;
}
li:hover a {
color: gold;
display: block;
transition: all .3s linear;
transform: scale(1.3, 1.3);
-ms-transform: scale(1.3, 1.3);
-webkit-transform: scale(1.3, 1.3);
}
I wrote a little html page that contains some buttons. What I want to do is to have them look like this :
I'm not good at all at css, I tried some combination but what I get is to have them "below the blue line" like this :
Here is my html code :
<div class="module form-module">
<div class="flex-container">
<article class="article">
<table>
<tr>
<td>
<button>Configurations</button>
</td>
<td>
<button>Create User </button>
</td>
<td>
<button>Update User</button>
</td>
<td>
<button>Create Group</button>
</td>
<td>
<button>Update Group</button>
</td>
</tr>
</table>
</article>
</div>
</div>
You can find my css code in that plunker : https://plnkr.co/edit/sCcBBFfWRiCwGz8hs8oR?p=catalogue
Can you please help me to fix this little problem in html ?
CSS changes:
.form-module {
border-bottom: 5px solid #33b5e5;
position: relative;
background: #ffffff;
width: 100%;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
margin: 0 auto;
align: right;
}
.flex-container > * {
padding: 15px;
-webkit-flex: 1 100%;
flex: 1 100%;
}
table {
border-spacing:0px;
}
td {
padding:0px;
}
Changes expalined:
The blue line is a border, and was set on the button's parent container. It was set to top when you wanted it to be on the bottom, so that's first change.
Then you had padding, which was separating the buttons from the edges of the container, that's second change, set it to 0px.
Finally, both the table and each button had a 1px border which would separate it from the edges of the container, third change was setting those borders to 0px.
Small suggestion:
In case you're not aware: it's really helpful to use browser inspector to better understand what's going on with CSS. Also, if you don't wish to make everything from scratch, I'd recommend you have a look at Bootstrap, it's quite easy and might save you a bunch of time.
Good luck.
In case it's useful, here's the complete CSS:
body {
background: #e9e9e9;
color: #666666;
font-family: 'RobotoDraft', 'Roboto', sans-serif;
font-size: 14px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
table {
border-spacing:0px;
}
td {
padding:0px;
}
/* Pen Title */
.pen-title {
padding: 50px 0;
text-align: center;
letter-spacing: 2px;
}
.pen-title h1 {
margin: 0 0 20px;
font-size: 48px;
font-weight: 300;
}
.pen-title span {
font-size: 12px;
}
.pen-title span .fa {
color: #33b5e5;
}
.pen-title span a {
color: #33b5e5;
font-weight: 600;
text-decoration: none;
}
/* Form Module */
.form-module {
position: relative;
background: #ffffff;
width: 100%;
border-bottom: 5px solid #33b5e5;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
margin: 0 auto;
align: right;
}
.form-module .toggle {
cursor: pointer;
position: absolute;
top: -0;
right: -0;
background: #33b5e5;
width: 30px;
height: 30px;
margin: -5px 0 0;
color: #ffffff;
font-size: 12px;
line-height: 30px;
text-align: center;
}
.form-module .toggle .tooltip {
position: absolute;
top: 5px;
right: -65px;
display: block;
background: rgba(0, 0, 0, 0.6);
width: auto;
padding: 5px;
font-size: 10px;
line-height: 1;
text-transform: uppercase;
}
.form-module .toggle .tooltip:before {
content: '';
position: absolute;
top: 5px;
left: -5px;
display: block;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid rgba(0, 0, 0, 0.6);
}
.form-module .form {
display: none;
padding: 40px;
}
.form-module .form:nth-child(2) {
display: block;
}
.form-module h2 {
margin: 0 0 20px;
color: #33b5e5;
font-size: 18px;
font-weight: 400;
line-height: 1;
}
.form-module table {
width: 100%
}
.form-module input {
outline: none;
width: 80%;
border: 1px solid #d9d9d9;
padding: 10px 15px;
font-weight: 400;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.form-module input:focus {
border: 1px solid #33b5e5;
color: #333333;
}
.form-module button {
cursor: pointer;
background: #33b5e5;
width: 90%;
border: 0;
padding: 10px 15px;
color: #ffffff;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.form-module button:hover {
background: #178ab4;
}
.form-module select {
cursor: pointer;
width: 85%;
height:80%;
padding: 10px 15px;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.flag button {
background: white;
color: #178ab4;
}
.flag button:hover {
background: white;
border: 20px;
border-color: #178ab4;
}
.flag {
cursor: pointer;
background: white;
width: 100%;
border: 0;
padding: 10px 15px;
border-color: #178ab4;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.flag a {
cursor: pointer;
background: white;
width: 100%;
border: 0;
color: #33b5e5;
border-color: #178ab4;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.flag a :hover {
background: white;
}
.form-module .cta {
background: #f2f2f2;
width: 100%;
padding: 15px 40px;
box-sizing: border-box;
color: #666666;
font-size: 12px;
text-align: center;
}
.form-module .cta a {
color: #333333;
text-decoration: none;
}
.flex-container {
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
align: right;
}
.flex-container > * {
padding: 0px;
-webkit-flex: 1 100%;
flex: 1 100%;
}
.article {
text-align: left;
}
.detail button {
width: 120px
}
.detail table {
border-collapse: separate;
border-spacing: 5px 10px;
width: 100%
}
.search table {
border-collapse: separate;
border-spacing: 5px 10px;
width: 70%
}
.search button {
width: 120px
}
.search input {
outline: none;
width: 90%;
border: 1px solid #d9d9d9;
padding: 10px 15px;
font-weight: 400;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.search select {
cursor: pointer;
width: 90%;
padding: 10px 15px;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.resultSearch table {
border-collapse: separate;
border-spacing: 5px 10px;
width: 80%
}
.dropbtn {
outline: none;
border:1;
width: 80%;
border: 1px solid #d9d9d9;
padding: 10px 15px;
font-size: 16px;
cursor: pointer;
}
.dropbtn:hover, .dropbtn:focus {
}
#myInput {
border-box: box-sizing;
background-image: url('searchicon.png');
background-position: 14px 12px;
background-repeat: no-repeat;
font-size: 16px;
outline: none;
width: 100%;
border: 1px solid #d9d9d9;
padding: 10px 15px;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f6f6f6;
min-width: 230px;
overflow: auto;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown a:hover {background-color: #ddd}
.show {display:block;}
#searchbox
{
width: 35px;
}
#media all and (min-width: 768px) {
.nav {text-align:left;-webkit-flex: 1 auto;flex:1 auto;-webkit-order:1;order:1;}
.article {-webkit-flex:5 0px;flex:5 0px;-webkit-order:2;order:2;}
footer {-webkit-order:3;order:3;}
}
.newUser button {
width: 120px
}
.newUser table {
border-collapse: separate;
border-spacing: 5px 10px;
width: 90%
}
.return table{
border-collapse: separate;
border-spacing: 5px 10px;
width: 90%;
}
.returnCheckBox input {
align: left;
width:0%;
}
.invoiceListTable table {
border-collapse: separate;
border-spacing: 5px 10px;
width: 90%
}
.sessionInfo table {
border-collapse: separate;
border-spacing: 5px 10px;
width: 100%;
align: right;
}
.sessionInfo {
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
align: right;
}
.sessionInfo > * {
padding: 15px;
-webkit-flex: 1 100%;
flex: 1 100%;
align: right;
}
.sessionInfo {
position: relative;
background: #ffffff;
width: 20%;
border-top: 5px solid #33b5e5;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
margin: 0 auto;
align: right;
}
.sessionInfo .toggle {
cursor: pointer;
position: absolute;
top: -0;
right: -0;
background: #33b5e5;
width: 30px;
height: 30px;
margin: -5px 0 0;
color: #ffffff;
font-size: 12px;
line-height: 30px;
text-align: center;
}
.sessionInfo .toggle .tooltip {
position: absolute;
top: 5px;
right: -65px;
display: block;
background: rgba(0, 0, 0, 0.6);
width: auto;
padding: 5px;
font-size: 10px;
line-height: 1;
text-transform: uppercase;
}
.sessionInfo .toggle .tooltip:before {
content: '';
position: absolute;
top: 5px;
left: -5px;
display: block;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid rgba(0, 0, 0, 0.6);
}
.form-module .form {
display: none;
padding: 40px;
align:right;
}
UPDATE:
You mentioned the buttons should be outside and above the form-module, so the html needs to be changed and not just the css. We removed the flex-container div which was nested inside form-module div and placed it after this container is closed. Since the buttons were getting their layout properties from .form-module's style, it was necessary to create a new class "buttons". Basically now form-module and buttons are in different containers and with separated style properties.
To understand how container blocks work:
http://www.w3schools.com/html/html_blocks.asp
html:
<div class="flex-container buttons">
<article class="article">
<table>
<tr>
<td>
<button>Configurations</button>
</td>
<td>
<button>Create User </button>
</td>
<td>
<button>Update User</button>
</td>
<td>
<button>Create Group</button>
</td>
<td>
<button>Update Group</button>
</td>
</tr>
</table>
</article>
</div>
<div class="module form-module">
</div>
changed css:
body {
background: #e9e9e9;
color: #666666;
font-family: 'RobotoDraft', 'Roboto', sans-serif;
font-size: 14px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.buttons table {
width: 100%;
border-spacing:0px;
}
.buttons td {
padding:0px;
}
.buttons input {
outline: none;
width: 80%;
border: 1px solid #d9d9d9;
padding: 10px 15px;
font-weight: 400;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.buttons input:focus {
border: 1px solid #33b5e5;
color: #333333;
}
.buttons button {
cursor: pointer;
background: #33b5e5;
width: 90%;
border: 0;
padding: 10px 15px;
color: #ffffff;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.buttons button:hover {
background: #178ab4;
}
.buttons select {
cursor: pointer;
width: 85%;
height:80%;
padding: 10px 15px;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
complete css:
body {
background: #e9e9e9;
color: #666666;
font-family: 'RobotoDraft', 'Roboto', sans-serif;
font-size: 14px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.buttons table {
width: 100%;
border-spacing:0px;
}
.buttons td {
padding:0px;
}
.buttons input {
outline: none;
width: 80%;
border: 1px solid #d9d9d9;
padding: 10px 15px;
font-weight: 400;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.buttons input:focus {
border: 1px solid #33b5e5;
color: #333333;
}
.buttons button {
cursor: pointer;
background: #33b5e5;
width: 90%;
border: 0;
padding: 10px 15px;
color: #ffffff;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.buttons button:hover {
background: #178ab4;
}
.buttons select {
cursor: pointer;
width: 85%;
height:80%;
padding: 10px 15px;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
/* Pen Title */
.pen-title {
padding: 50px 0;
text-align: center;
letter-spacing: 2px;
}
.pen-title h1 {
margin: 0 0 20px;
font-size: 48px;
font-weight: 300;
}
.pen-title span {
font-size: 12px;
}
.pen-title span .fa {
color: #33b5e5;
}
.pen-title span a {
color: #33b5e5;
font-weight: 600;
text-decoration: none;
}
/* Form Module */
.form-module {
position: relative;
background: #ffffff;
width: 100%;
border-top: 5px solid #33b5e5;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
margin: 0 auto;
align: right;
}
.form-module .toggle {
cursor: pointer;
position: absolute;
top: -0;
right: -0;
background: #33b5e5;
width: 30px;
height: 30px;
margin: -5px 0 0;
color: #ffffff;
font-size: 12px;
line-height: 30px;
text-align: center;
}
.form-module .toggle .tooltip {
position: absolute;
top: 5px;
right: -65px;
display: block;
background: rgba(0, 0, 0, 0.6);
width: auto;
padding: 5px;
font-size: 10px;
line-height: 1;
text-transform: uppercase;
}
.form-module .toggle .tooltip:before {
content: '';
position: absolute;
top: 5px;
left: -5px;
display: block;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid rgba(0, 0, 0, 0.6);
}
.form-module .form {
display: none;
padding: 40px;
}
.form-module .form:nth-child(2) {
display: block;
}
.form-module h2 {
margin: 0 0 20px;
color: #33b5e5;
font-size: 18px;
font-weight: 400;
line-height: 1;
}
.form-module table {
width: 100%
}
.form-module input {
outline: none;
width: 80%;
border: 1px solid #d9d9d9;
padding: 10px 15px;
font-weight: 400;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.form-module input:focus {
border: 1px solid #33b5e5;
color: #333333;
}
.form-module button {
cursor: pointer;
background: #33b5e5;
width: 90%;
border: 0;
padding: 10px 15px;
color: #ffffff;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.form-module button:hover {
background: #178ab4;
}
.form-module select {
cursor: pointer;
width: 85%;
height:80%;
padding: 10px 15px;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.flag button {
background: white;
color: #178ab4;
}
.flag button:hover {
background: white;
border: 20px;
border-color: #178ab4;
}
.flag {
cursor: pointer;
background: white;
width: 100%;
border: 0;
padding: 10px 15px;
border-color: #178ab4;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.flag a {
cursor: pointer;
background: white;
width: 100%;
border: 0;
color: #33b5e5;
border-color: #178ab4;
-webkit-transition: 0.3s ease;
transition: 0.3s ease;
}
.flag a :hover {
background: white;
}
.form-module .cta {
background: #f2f2f2;
width: 100%;
padding: 15px 40px;
box-sizing: border-box;
color: #666666;
font-size: 12px;
text-align: center;
}
.form-module .cta a {
color: #333333;
text-decoration: none;
}
.flex-container {
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
align: right;
}
.flex-container > * {
padding: 0px;
-webkit-flex: 1 100%;
flex: 1 100%;
}
.dropbtn {
outline: none;
border:1;
width: 80%;
border: 1px solid #d9d9d9;
padding: 10px 15px;
font-size: 16px;
cursor: pointer;
}
.dropbtn:hover, .dropbtn:focus {
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f6f6f6;
min-width: 230px;
overflow: auto;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown a:hover {background-color: #ddd}
.show {display:block;}
ul{
list-style-type:none;
width:500px;
}
li{
width:33%;
text-align:center;
float:left;
border-bottom:2px solid #33b5e5;
}
Maybe instead of a 'table' use a 'list' html element like ul or li.
plunker
New HTML:
<div class="module form-module">
<div class="flex-container">
<article class="article">
<ul>
<li>
<button>Configurations</button>
</li>
<li>
<button>Create User </button>
</li>
<li>
<button>Update User</button>
</li>
</ul>
</article>
</div>
</div>
and add the following CSS:
ul{
list-style-type:none;
width:500px;
}
li{
width:33%;
text-align:center;
float:left;
border-bottom:2px solid #33b5e5;
}