I've having problems rending off screen elements properly. I believe the problem has to do with overflow properties. If I view the browser at full screen(1080p) its fine, but when I resize the browser to a smaller resolution, and then SCROLL down, the styles disappear for off screen elements.
EDIT [ Removed links to prevent broken links in the future ]
/* DEFAULT */
* {
margin: 0px;
font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
}
#font-face {
font-family: leela;
src: url('leelawad_0.ttf');
}
html, body {
height: 100%;
background-color: rgb(255,255,255);
}
h1 {
color: rgb(183,183,183);
font-family: leela;
font-size: 16px;
font-weight: normal;
text-transform: uppercase;
}
a {
color: rgb(102,102,102);
text-decoration: none;
}
/* ID */
#container {
height: 100%;
overflow-x: hidden;
width: 100%;
}
#header {
border: 1px solid rgb(153,153,153);
border-top: 0px;
background-color: rgb(255,255,255);
padding: 8px;
position: fixed;
width: 100%;
z-index: 3;
}
#quickSearch {
border: 1px solid rgb(153,153,153);
background-color: rgb(250,250,250);
height: 30px;
margin: 8px 8px 8px 8px;
}
#quickSearch input {
background-color: rgb(250,250,250);
border: 0px;
height: 28px;
margin-left: 10px;
margin-top: 0px;
float: left;
}
#naviContainer {
float: left;
width: 200px;
border-right: 1px solid rgb(153,153,153);
background-color: rgb(225,225,225);
height: 100%;
}
#navigation {
background-color: rgb(225,225,225);
float: left;
width: 200px;
margin-top: 31px;
position: relative;
z-index: 2;
height: 100%;
}
#navigation ul {
margin: 0px;
padding: 0px;
width: 200px;
}
#navigation li {
display: block;
list-style-type: none;
-webkit-transition: all 0.25s ease-in-out;
-moz-transition: all 0.25s ease-in-out;
-o-transition: all 0.25s ease-in-out;
transition: all 0.25s ease-in-out;
}
#navigation li:hover {
background-color: rgb(173,173,173);
-webkit-transition: all 0.25s ease-in-out;
-moz-transition: all 0.25s ease-in-out;
-o-transition: all 0.25s ease-in-out;
transition: all 0.25s ease-in-out;
}
#navigation h1 {
border-bottom: 1px dotted rgb(153,153,153);
background-color: rgb(127,127,127);
padding: 8px;
}
#navigation h1.fix {
border-top: 1px dotted rgb(153,153,153);
}
#navigation ul li {
border-bottom : 1px dotted rgb(153,153,153);
}
#navigation li a {
display: block;
padding: 8px;
}
#contentContainer {
margin-left: 201px;
margin-top: 31px;
position: relative;
}
#breadcrumbs {
background-color: rgb(239,239,239);
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: rgb(153,153,153);
padding: 8px;
position: inherit;
}
#breadcrumbs ul {
display: inline;
margin-left: 0px;
padding: 0px;
}
#breadcrumbs li {
display: inline;
}
#content {
padding: 8px;
position: inherit;
}
/* CLASSES */
.divider {
border-left: solid 1px rgb(102,102,102);
margin: 0px 7px 0px 5px;;
}
Any input would be greatly appreciated!
Try adding using position:fixed (I made it yellow so it would stand out):
#navigation {
background-color: yellow;
border-right: 1px solid #999999;
border-top: 0 none;
float: left;
height: 100%;
margin-top: 31px;
position: fixed;
width: 200px;
z-index: 2;
}
[Edit] 2nd attempt, remove height.
#navigation {
background-color: #E1E1E1;
float: left;
//height: 100%;
margin-top: 31px;
position: relative;
width: 200px;
z-index: 2;
}
that was nothing more then height:100% issue
Remove height:100% from #naviContainer will fix this.
#navigation {
background-color: #E1E1E1;
float: left;
min-height: 100%;
margin-top: 31px;
position: relative;
width: 200px;
z-index: 2;
}
#naviContainer {
background-color: #E1E1E1;
border-right: 1px solid #999999;
float: left;
min-height: 100%; /* the fix */
width: 200px;
}
Related
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;
}
a bit new to web development so bear with me. As you can see in the Codepen I've made here, I am developing a prototype messaging client. I'd like the Chat Name and the Preview Text to be one under the other, really close like in the image here. I'd also like to have another Div/Span at the end of the the button that will have some inner text as well, like in the image where it says "Now".
Here's my CSS for reference, how can I get the two (three, really) divs to be in the correct place.
.nav-side-menu {
overflow: hidden;
font-size: 18px;
font-weight: 100;
border-right: 1px solid #484848;
background-color: #e6e6e6;
position: fixed;
top: 0px;
width: 20%;
height: 100%;
color: #484848;
}
.nav-side-menu .brand {
background-color: #e6e6e6;
line-height: 75px;
display: block;
text-align: center;
font-size: 32px;
border-bottom: 1px solid #484848;
}
.chat-header {
position: fixed;
left: 20%;
width: 80%;
background-color: #e6e6e6;
line-height: 75px;
display: block;
text-align: center;
font-size: 32px;
border-bottom: 1px solid #484848;
}
.nav-side-menu .toggle-btn {
display: none;
}
.nav-side-menu ul,
.nav-side-menu li {
list-style: none;
padding: 0px;
margin: 0px;
line-height: 80px;
cursor: pointer;
}
.nav-side-menu ul :not(collapsed) .arrow:before,
.nav-side-menu li :not(collapsed) .arrow:before {
/*font-family: FontAwesome;*/
content: "\f078";
display: inline-block;
padding-left: 10px;
padding-right: 10px;
vertical-align: middle;
float: right;
}
.nav-side-menu ul .active,
.nav-side-menu li .active {
background-color: #3ab795;
}
.nav-side-menu li {
padding-left: 0px;
border-bottom: 1px solid #484848;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
}
.nav-side-menu li a {
padding-left: 20px;
padding-top: 29px;
padding-bottom: 29px;
padding-right: 100%;
text-decoration: none;
color: #484848;
}
.nav-side-menu li a i {
padding-left: 10px;
width: 20px;
padding-right: 20px;
}
.nav-side-menu li:hover {
background-color: #3ab795;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#searchbox{
width: 100%;
position: relative;
margin: 5px 0 5px 0;
padding: 3px 10px 3px 20px;
box-sizing: border-box;
border: 1px solid #484848;
border-radius: 20px;
background-color: #e6e6e6;
}
.search-menu{
border-bottom: 1px solid #484848;
padding: 5px;
}
.chat-box{
position: fixed;
bottom: 0;
width: 80%;
height: 60px;
left: 20%;
background-color: #e6e6e6;
border-top: 1px solid #484848;
}
#message-box{
width: 95%;
position: relative;
margin: 15px 5px 5px 5px;
padding: 3px 10px 3px 20px;
border: 1px solid #484848;
border-radius: 20px;
background-color: #e6e6e6;
}
.send-message{
background-color: #3ab795;
width: 3%;
height: 30px;
border-radius: 5px;
border: none;
}
.send-message:focus{
outline: 0;
}
.send-message:active{
background-color: #29a281;
}
.preview-text{
font-size: 11px;
}
#media (max-width: 767px) {
.nav-side-menu {
position: relative;
width: 100%;
margin-bottom: 10px;
}
.nav-side-menu .toggle-btn {
display: block;
cursor: pointer;
position: absolute;
right: 20px;
top: 5px;
z-index: 10 !important;
padding: 3px;
background-color: #e6e6e6;
color: #484848;
width: 30px;
text-align: center;
}
.brand {
text-align: left !important;
font-size: 22px;
padding-left: 20px;
line-height: 50px !important;
}
}
#media (min-width: 767px) {
.nav-side-menu .menu-list .menu-content {
display: block;
}
}
body {
margin: 0px;
padding: 0px;
font-family: 'Roboto', sans-serif;
}
.nano { height: 85%; }
.nano .nano-pane { background: #888; }
.nano .nano-slider { background: #111; }
http://codepen.io/djkantoci/pen/KNGYbv
Change line-height to 1.5 (or some other value, but don't use pixels).
Add some padding-right to li (to make space for time text), append time and add position: absolute to that time div (don't forget to make li element relative)
Your code is pretty much right. Because of line height, that element getting so much height. Please have a look at below code.
.nav-side-menu ul,
.nav-side-menu li{
line-height: normal;
}
.nav-side-menu li> div {
padding: 5px 12px;
}
Adjust the line height on your nav-side-menu elements
.nav-side-menu ul,
.nav-side-menu li {
list-style: none;
padding: 0px;
margin: 0px;
line-height: 30px;
cursor: pointer;
}
I have an issue with my dropdown menu. I have a table and at the end of each row i have a dropdown menu like that :
When i hover the menu on every browser i got this :
Except on IE11 :
Here is my CSS :
#dropdown_classe {
margin: 10px 0 20px 0;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
}
#dropdown_classe .wrapper {
display: inline-block;
width: 180px;
margin: 0 10px 0 0;
height: 20px;
position: relative;
}
#dropdown_classe .parent {
height: 100%;
width: 100%;
display: block;
cursor: pointer;
line-height: 30px;
height: 30px;
border-radius: 5px;
background: #F9F9F9;
border: 1px solid #AAA;
border-bottom: 1px solid #777;
color: #282D31;
font-weight: bold;
font-size: 13px;
z-index: 2;
position: relative;
-webkit-transition: border-radius .1s linear, background .1s linear, z-index 0s linear;
-webkit-transition-delay: .8s;
text-align: center;
}
#dropdown_classe .parent:hover,
#dropdown_classe .content:hover ~ .parent {
background: #fff;
-webkit-transition-delay: 0s, 0s, 0s;
}
#dropdown_classe .content:hover ~ .parent {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
z-index: 0;
}
#dropdown_classe .content {
position: absolute;
top: 0;
display: block;
z-index: 1;
height: 0;
width: 180px;
padding-top: 30px;
-webkit-transition: height .3s ease;
-webkit-transition-delay: .2s;
border: 1px solid #777;
border-radius: 5px;
box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
#dropdown_classe .wrapper:hover .content {
height: 253px;
z-index: 3;
-webkit-transition-delay: 0s;
}
#dropdown_classe .content:hover {
height: 253px;
z-index: 3;
-webkit-transition-delay: 0s;
}
#dropdown_classe .content ul {
background: #fff;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
#dropdown_classe .content ul a {
text-decoration: none;
}
#dropdown_classe .content li:hover {
background: #eee;
color: #333;
}
#dropdown_classe .content li {
list-style: none;
text-align: left;
color: #888;
font-size: 13px;
line-height: 30px;
height: 30px;
padding-left: 10px;
border-top: 1px solid #ccc;
}
#dropdown_classe .content li:last-of-type {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
If you have any advice please let me know
Ctbs1
I fixed this issue with this :
<meta http-equiv="X-UA-Compatible" content="IE=edge">
This may be a simple styling issue, but I am stuck. I tried setting a min-height on the LI elements of the dropdown, still no avail. Any assistance would be great. In the screenshot you can see a little white text showing under the logo. Those are obviously the links.
stylesheet:
body {
background-color: #eee;
color: #86888A;
font: 400 16px/28px "Open Sans", Helvetica, Arial, sans-serif;
word-wrap: break-word;
text-rendering: optimizelegibility;
overflow-x: hidden;
}
::selection {
background: #eaeaea;
}
#wrap {
max-width: 900px;
min-width: 280px;
margin: 90px auto;
}
/************************HEADER************/
h1 { color: white;}
#header {
background-color: #121314;
height: 160px;
padding-top: 36px;
}
#header a {
color: white;
text-decoration: none;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
transition: all 0.6s ease;
text-transform: uppercase;
letter-spacing: 8px;
}
#header a:hover {
color: #f44238;
}
.navbar-brand {
font-size: 2.00em;
}
#media (max-width: 510px) {
.navbar-brand {
letter-spacing: 8px;
font-size: 26px;
}
}
#media (max-width: 450px) {
.navbar-brand {
letter-spacing: 6px !important;
font-size: 18px;
}
}
.navbar-nav > li{
font-size: 0.8em;
}
.nav>li>a:hover {
background-color: transparent;
}
.icon-bar {
background-color: white;
}
.navbar-nav {
z-index: 999;
position: relative;
background-color:#121314
}
#media (max-width: 990px) {
.navbar-header {
float: none;
}
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
z-index: 999;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
padding: 0;
}
.navbar-collapse.collapse {
display: none!important;
padding: 0;
}
.navbar-nav {
float: none!important;
margin-top: 7.5px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
.collapse.in{
display:block !important;
padding: 0;
}
}
/*********************************/
.row {
margin-left: 0px !important;
margin-right: 0px !important;
max-width: 900px;
min-width: 280px;
background-color: white;
}
#content {
padding-left: 0px !important;
padding-right: 0px !important;
}
.post {
margin-bottom: 10%;
}
.postheader {
font-size: 2.00em;
margin-bottom: 10px;
}
.postheader a {
text-decoration: none;
color: #21282E;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
transition: all 0.6s ease;
text-align: left !important;
}
.postheader a:hover {
color: #f44238;
cursor: pointer;
}
#media (max-width: 675px) {
.postheader {
font-size: 1.7em;
text-align: center;
}
}
#media (max-width: 500px) {
.postheader {
font-size: 1.2em;
text-align: center;
}
}
.meta {
font-size: 12px;
}
.postimg {
position: relative;
width:100%;
height: 0;
padding-bottom: 50%;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.postcontent {
margin: 0 auto;
width: 80%;
text-align: justify;
}
.postcontent p {
margin: 10px 0 40px;
}
.entity {
padding-top: 25px;
}
.more-link {
background-color: black;
width: 60px;
height: 30px;
color: white;
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
box-shadow: none;
text-align: center;
padding: 6px;
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
transition: all 0.6s ease;
}
.more-link:hover {
background-color: #f44238;
text-decoration: none;
color: white;
}
hr {
margin-top: 40px;
background-color: none;
height: 1px;
border: none;
}
hr::after {
display: block;
width: 125%;
height: 1px;
background-color: tomato;
position: relative;
left: -25%;
top: 1px;
content: "/";
color: tomato;
text-align: right;
line-height: 0px;
}
hr::before {
display: block;
width: 125%;
height: 1px;
background-color: tomato;
position: relative;
left: -25%;
top: -1px;
content: "|";
color: tomato;
text-indent: -1px;
line-height: 6px;
}
.pagination>li>a {
color: #f44238;
}
.pagination>li>a:hover {
color:#f44238;
}
.pagination>.active>a {
background-color: black;
border: 0px;
}
.pagination>.active>a:hover {
background-color:black;
}
.portfolio-item {
margin-bottom: 25px;
margin-top: 35px;
}
.portfolio-item>h3 {
text-align: center;
}
.portfolio-item>p {
text-align: center;
}
add this to the media query
.navbar-collapse.in {
overflow-y: visible;
}
The Problem is, that if you resize the window to a really small size, the menu button breaks down to the space, which is required for the the dropdown.
A fix could be:
.navbar-toggle {
background-color: rgba(0, 0, 0, 0);
background-image: none;
border: 1px solid rgba(0, 0, 0, 0);
border-radius: 4px;
float: right;
margin-bottom: 8px;
margin-right: 15px;
margin-top: 8px;
padding: 9px 10px;
position: absolute; <--
right: 0; <--
}
.navbar-header {
position: relative;
}
and readd the overflow-x: hidden;