Mkdocs with material theme: extra css not working on mobile devices - css

I'm using Mkdocs with material theme for products documentation on my company. I'd made some customize on the original theme using the extra.css file.
When people navigate on my site on web browser it's working ok.
When they navigate on mobile devices, the extra.css is not working, or having a very strange behavior.
On the images of mobile devices, the left side is when I open the menu. The right side is when I click in a link in the menu.
Here is my extra.css file.
.md-header__button.md-logo :-webkit-any(img,svg) {
display: block;
width: auto;
height: 2rem;
fill: currentColor;
}
.md-nav--primary {
font-size: .75rem;
line-height: 1.5;
background-color: #0000cc;
border-color: #eee;
border-width: thin;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
padding-top: .6rem;
padding-bottom: .6rem;
}
.md-header {
background-color: #0000cc;
}
input.md-search__input {
width: 100%;
height: 1.8rem;
padding-left: 2.2rem;
font-size: .8rem;
opacity: 1;
background-color: rgba(0,0,0,1);
border-radius: 16px;
text-align: left;
letter-spacing: 0px;
color: #ffffff;
opacity: 1;
}
.md-search__input:hover {
background-color: rgba(0,0,0,1);
}
.md-search-result__teaser {
display: -webkit-box;
max-height: 2rem;
color: #00348b;
margin: .5em 0;
overflow: hidden;
font-size: .64rem;
line-height: 1.6;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
[data-md-toggle=search]:checked~.md-header .md-search__input {
text-overflow: clip;
background-color: var(--md-default-bg-color);
border-radius: .1rem .1rem 0 0;
color: #00348b;
}
.md-search-result__meta {
padding: 0 .8rem;
color: #00348b;
font-size: .64rem;
line-height: 1.8rem;
scroll-snap-align: start;
}
.md-nav--primary, .md-nav--secondary {
font-size: .75rem;
line-height: 1.5;
background-color: #eee;
-moz-border-radius: 8px;
border-radius: 8px;
padding-top: .6rem;
padding-bottom: .6rem;
background: #00348B 0% 0% no-repeat padding-box;
}
.md-nav__title {
display: block;
padding: 0 .6rem;
overflow: hidden;
font-weight: 700;
text-overflow: ellipsis;
color: #ffffff;
}
.md-nav__item .md-nav__link--active {
text-align: left;
font: normal normal normal 14px/18px Open Sans;
letter-spacing: 0.35px;
color: #FFFFFF;
opacity: 1;
}
.md-nav__item--nested>.md-nav__link {
color: #FFFFFF;
}
.md-nav__link {
display: block;
margin-top: .625em;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
transition: color 125ms;
scroll-snap-align: start;
text-align: left;
letter-spacing: 0.33px;
color: #FFFFFF;
opacity: 1;
}
.md-nav__link[data-md-state=blur] {
color: #d5d5d5;
}
.md-footer {
color: #FFFFFF;
background : #00348B 0% 0% no-repeat padding-box;
}
.md-float-right {
height: 100%;
margin: 430px 0 0 650px;
display: inline-block;
align-items: flex-end;
position: fixed;
}
p {
display: block;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
text-align: justify;
}

Related

how do I make it so my mobile responsive works on my web page?

I am trying to make my page mobile responsive but something is off. I had to change position of my nav-menu from absolute to relative for nav menu to go to the right top corner but now im having issues with the responsive part as well as the collapse of menu. i have been in tutorial hell trying to understand relative and absolute. I thought I had it but this proves i do not
/* make for mobile*/
.mobile-nav-toggle {
position: fixed;
right: 15px;
top: 15px;
z-index: 9998;
border: 0;
background: none;
font-size: 24px;
transition: all 0.4s;
outline: none !important;
line-height: 1;
cursor: pointer;
text-align: right;
}
.mobile-nav-toggle i {
color: #ffff;
}
.mobile.nav {
position: fixed;
top: 55px;
right: 15px;
bottom: 15px;
z-index: 0;
overflow-y: auto;
background: rgba(0,0,0,0.7);
}
The rest of the script :
body {
font-family: "open sans",sans-serif;
background-color: #040404;
color: #fff;
position: relative;
background: transparent;
}
body::before {
content: "";
position: fixed;
background: #040404;
left: 0;
background-size: cover;
right: 0;
top: 0;
height: 100vh;
z-index: -1;
}
#media (min-width: 1024px){
body::before {
background-attachment: fixed;
}
}
a {
color: #18d26e;
}
a:hover {
color: #18d26e;
text-decoration: none;
}
h1,h2,h3,h4,h5,h6 {
font-family: "Railewa", sans-serif;
}
/*==========Header=======*/
#header {
transition: ease-in-out 0.3s;
position: relative;
height: 100vh;
display: flex;
align-items: center;
z-index: 997;
overflow-y: auto;
}
#header * {
transition: ease-in-out 0.3s;
}
#header h1 {
font-size: 48px;
margin: 0;
padding: 0;
line-height: 1;
font-weight: 700;
font-family: "poppins",sans-serif;
}
#header h1 a,
#header h1 a:hover {
color: #fff;
line-height: 1;
display: inline-block;
}
header h2 {
font-size: 24px;
margin-top: 20px;
color: rgba(255,255,255,0.8);
}
#header h2 span {
color: #fff;
border-bottom: 2px solid #18d26e;
padding-bottom: 6px;
}
#header h2 span:hover {
color: #ffff;
border-bottom: 2px solid #ff28f4;
padding-bottom: 6px;
}
#header .social-links {
margin-top: 40px;
display: flex;
}
#header .social-links a {
font-size: 16px;
display: flex;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255,0.1);
color: #ffff;
line-height: 1;
margin-right: 8px;
border-radius: 50%;
width: 40px;
height: 40px;
}
#header .social-links a:hover {
background: #18d26e;
}
/*make it resposive*/
#media (max-width:992px) {
#header h1 {
font-size: 36px;
}
#header h2 {
font-size: 20px;
line-height: 30px;
}
#header .social-links {
margin-top: 15px;
}
#header .container {
display: flex;
flex-direction: column;
align-items: center;
}
}

Remove footer white space on the left and right side

I'm trying to remove the white space on the right and left side of my footer, it keeps making it when I put the code "max-width: 1200px; margin: auto;" to center the content. What other ways can I center the content and at the same time remove the white gaps on both sides?
I tried using margin-top, margin-left, margin-right, bootstrap's pull-left and pull-right, margin and padding set to 0, width:100% etc. Nothing worked.
Thanks.
My code is this:
body {
margin-left: 0;
padding: 0;
}
footer{
position: relative;
bottom: 0;
max-width: 1200px;
margin: auto;
overflow-x: hidden;
}
.footer-distributed{
background-color: #2c2c2c;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
width: 100%;
text-align: left;
font: normal 16px 'Varela Round';
padding: 20px 50px;
margin-top: 10px;
}
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right, .mapouter .gmap_canvas{
display: inline-block;
vertical-align: top;
}
.footer-distributed .footer-left{
width: 40%;
}
.footer-distributed h3{
color: #ffffff;
font: normal 36px 'Varela Round', cursive;
margin: 0;
}
.footer-distributed h3 span{
color: #ffffff;
}
.footer-distributed .footer-links{
color: #ffffff;
margin: 20px 0 12px;
padding: 0;
}
.footer-distributed .footer-links a{
display:inline-block;
line-height: 1.8;
text-decoration: none;
color: inherit;
}
.footer-distributed .footer-company-name{
color: #8f9296;
font-size: 14px;
font-weight: normal;
margin: 0;
}
.footer-distributed .footer-center{
width: 35%;
padding-top:18px;
}
.footer-distributed .footer-center i{
background-color: #33383b;
color: #ffffff;
font-size: 25px;
width: 38px;
height: 38px;
border-radius: 50%;
text-align: center;
line-height: 42px;
margin: 10px 15px;
vertical-align: middle;
}
.footer-distributed .footer-center i.fa-envelope{
font-size: 17px;
line-height: 38px;
}
.footer-distributed .footer-center p{
display: inline-block;
color: #ffffff;
vertical-align: middle;
margin:0;
}
.footer-distributed .footer-center p span{
display:block;
font-weight: normal;
font-size:14px;
line-height:2;
}
.footer-distributed .footer-center p a{
color: #cd2030;
text-decoration: none;
}
.footer-distributed .footer-right{
width: 20%;
padding-top:18px;
}
.footer-distributed .footer-company-about{
line-height: 20px;
color: #92999f;
font-size: 13px;
font-weight: normal;
margin: 0;
}
.footer-distributed .footer-company-about span{
display: block;
color: #ffffff;
font-size: 17px;
font-weight: normal;
margin-bottom: 20px;
}
.footer-distributed .footer-icons{
margin-top: 25px;
}
.footer-distributed .footer-icons a{
display: inline-block;
width: 35px;
height: 35px;
cursor: pointer;
background-color: #33383b;
border-radius: 2px;
font-size: 20px;
color: #ffffff;
text-align: center;
line-height: 35px;
margin-right: 3px;
margin-bottom: 5px;
}
#media (max-width: 880px) {
.footer-distributed{
font: bold 14px 'varela round';
}
.copyright-info, .credit {
width: 100%;
text-align: center;
display: block;
vertical-align: middle;
margin-left: 0px;
margin-right: 0px;
}
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right{
display: block;
width: 100%;
margin-bottom: 40px;
text-align: center;
}
.footer-distributed .footer-center i{
margin-left: 0;
}
.main {
line-height: normal;
font-size: auto;
}
}
Use flexbox. All the elements within your footer will automatically center within the parent.
footer {
background-color: #2c2c2c;
position: relative;
bottom: 0;
left: 0;
width: 100vw;
display: flex;
align-items: center;
justify-content: center;
}
.footer-distributed {
padding: 1em;
display: flex;
align-items: flex-start;
justify-content: center;
max-width: 1200px;
width: 100%;
}

Can't align "a" tag

I am wondering why I can't move my .workButton to the center :D? I have tried text-align, or margin:0 auto, but nothing seems to work...
If you see some mistakes/or something that could be done differently, let me know, please!
Any tips would be really helpful!
Here is the link to the code (i wrote it in scss)
* {
margin: 0;
padding: 0; // box-sizing: border-box;
}
body {
font-family: "Titillium Web", sans-serif;
}
.container {
max-width: 1140px;
width: 100vw;
height: 100vh;
margin: 0 auto;
overflow: hidden; // grid-template-rows: 600px 750px 900px 650px 1420px 900px 820px 100px;
}
#hero {
max-height: 600px;
height: 100vh;
background-color: #87509c;
h1 {
text-align: center;
color: #f7f3ea;
font-size: 42px;
line-height: 50px;
margin-top: 140px;
margin-bottom: 60px;
}
.workButton {
text-align: center;
font-size: 18px;
font-weight: 600;
color: #ffffff;
padding: 20px 80px;
text-transform: uppercase;
text-decoration: none;
border: 1px solid #eb7d4b;
border-radius: 5px;
background-color: #eb7d4b;
box-shadow: 0 2px #c86a40;
}
}
.navbar {
display: flex;
margin: 60px 20px 20px 40px;
ul {
margin-left: auto;
list-style-type: none;
align-self: center;
li {
float: left;
a {
text-decoration: none;
color: #ffffff;
padding: 5px 20px;
text-transform: uppercase;
transition-duration: 1.5s;
}
a:hover {
background-color: #643a79;
border-radius: 3px;
transition-duration: .4s;
}
}
}
}
https://codepen.io/anon/pen/ZvXZLe
Apply text-align: center to your #hero wrapper and your link will center just fine.
The <a></a> does'nt has specific width. So, just add on .workButton,
#hero {
.workButton {
width: 100px;
text-align: center;
}
}
That's it...Thank You...

CSS: How to create a button with an arrow placedo on the right

I need to reproduce following button:
I have already tried to create it, but the arrow on the right is not the same as in the picture. How can I reproduce the same white arrow?
.sBtn {
display: inline-block;
background: #908589;
border: 0;
color: #fff;
font-weight: 700;
font-size: 1.2em;
letter-spacing: 0.04em;
line-height: 2.5em;
padding: 0 0 0 1em;
outline: none;
text-decoration: none;
margin-top: 14px;
}
...and so on...
https://jsfiddle.net/jobgaraux/h81z00jL/1/
Here I made it for you jsFiddle
Edited HTML:
<span class="arrowBtn"> <span class="icon"></span></span>
You can create CSS3 arrow from borders:
.sBtn-go .arrowBtn .icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 0;
height: 0;
border-style: solid;
border-width: 15px 0 15px 13px;
border-color: transparent transparent transparent white;
}
may be this will help youl
.sBtn {
display: inline-block;
background: #908589;
border: 0;
color: #fff;
font-weight: 700;
font-size: 1.2em;
letter-spacing: 0.04em;
line-height: 2.5em;
padding: 0 0 0 1em;
outline: none;
text-decoration: none;
margin-top: 14px;
}
.arrowBtn {
display: inline-block;
line-height: 2.5em;
text-align: center;
background: #333;
color: white;
font-size: 1em;
width: 2.5em;
transition: margin 200ms;
margin-left: .75em;
position:relative;
left:2px;
}
.sBtn-go .arrowBtn {
background-color: #B6AFB1;
}
.sBtn-go .arrowBtn:hover {
}
.sBtn-go .arrowBtn {
background-color: desaturate(darken(#F8AD6C,5%),5%);
}
<button class="sBtn sBtn-go" name="search">Search<span class="arrowBtn">&#x25BA</span></button>
.sBtn {
display: inline-block;
background: #908589;
border: 0;
color: #fff;
font-weight: 700;
font-size: 1.2em;
letter-spacing: 0.04em;
line-height: 2.5em;
padding: 0 0 0 1em;
outline: none;
text-decoration: none;
margin-top: 14px;
}
.arrowBtn {
display: inline-block;
line-height: 2.5em;
text-align: center;
background: #333;
color: white;
font-size: 1em;
width: 2.5em;
transition: margin 200ms;
margin-left: .75em;
}
.sBtn-go .arrowBtn {
background-color: #B6AFB1;
}
.sBtn-go .arrowBtn:hover {
}
.sBtn-go .arrowBtn {
background-color: desaturate(darken(#F8AD6C,5%),5%);
}
<button class="sBtn sBtn-go" name="search">Search<span class="arrowBtn">&#x25BA</span></button>

Button result not as desired

Why is it that when I test my page out on Chrome Canary emulating the iPad I get this result,
But when testing it out on the real device I get this
I'm trying to achieve the top one, but can't for some reason. Any ideas? Also is Chrome Canary reliable? Here's the CSS
#import url(http://fonts.googleapis.com/css?family=Open+Sans:300);
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #fff;
color: #7b8993;
font: 300 87.5%/1.5em 'Open Sans', sans-serif;
}
.form-wrapper {
padding-top: 10%;
border-radius: 2px;
margin: 50px auto;
position: relative;
width: 375px;
}
form {
padding: 30px 20px 0;
}
.form-item {
margin-bottom: 10px;
width: 100%;
}
.form-item input {
border: 1px solid #ccc;
border-radius: 2px;
color: #000;
font-family: 'Open Sans', sans-serif;
font-size: 1em;
height: 50px;
padding: 0 16px;
transition: background 0.3s ease-in-out;
width: 100%;
}
.form-item input:focus {
outline: none;
border-color: #9ecaed;
box-shadow: 0 0 10px #9ecaed;
}
.button-panel {
margin: 20px 0 0;
width: 100%;
}
.button-panel .button {
background: #009dff;
border: none;
border-radius: 2px;
color: #fff;
cursor: pointer;
height: 50px;
font-family: 'Open Sans', sans-serif;
font-size: 1.2em;
letter-spacing: 0.05em;
text-align: center;
text-transform: uppercase;
transition: background 0.3s ease-in-out;
width: 100%;
}
.button:hover {
background: #00c8ff;
}
#media only screen
and (max-width : 320px) {
.form-wrapper {
padding-top: 10%;
border-radius: 2px;
margin: 50px auto;
position: relative;
width: 320px;
}
}
.cent {
text-align: center;
color: #000;
}
.view {
text-align: center;
text-decoration: none;
color: #7b8993;
padding-top: 5px;
}
#ref {
text-align: center;
text-decoration: none;
color: #7b8993;
padding-top: 8px;
font-size: 16px;
}
#ref:hover {
text-align: center;
text-decoration: none;
color: #009dff;
-webkit-animation: hue 60s infinite linear;
padding-top: 8px;
font-size: 16px;
}
You need to add the following to the button element in order to remove the default styling.
-webkit-appearance: none;

Resources