Github pages css troubles only on smartphone - html

I am creating a website using Jekyll, and publishing it using Github pages. When I jekyll serve the website in local, everything works fine, and it looks normal both from my computer and smartphone. But when I visit the Github pages one from my smartphone, some divs seem to be shifted a bit, and the font-awesome icons are not rendered. Strangely, it works fine when I visit it (the Github pages one) from my computer.
I am not sure where to look at. Could something happen on github and be overriding only some media queries?
I have no idea yet what is relevant in the code, but I'll try to create some MCV example. Until then, the source code is here and the website is here.
Here's the CSS, mostly taken from a Pure css layout:
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/*
* -- BASE STYLES --
* Most of these are inherited from Base, but I want to change a few.
*/
body {
line-height: 1.7em;
color: #7f8c8d;
font-size: 13px;
}
h1,
h2,
h3,
h4,
h5,
h6,
label {
color: #34495e;
}
div.tweet-box {
font-size: 20px;
font-weight: bold;
border-left: 3px solid #1f8dd6;
padding: 1em 1.6em;
font-weight: 100;
border-radius: 5px;
line-height: 1em;
}
.fat {
font-weight: bold;
}
a.shy-link {
text-decoration: none;
color: #7f8c8d;
}
a:visited.shy-link{
text-decoration: none;
color: #7f8c8d;
}
a:hover.shy-link{
text-decoration: none;
color: #34495e;
}
.pure-img-responsive {
max-width: 100%;
height: auto;
}
/*
* -- LAYOUT STYLES --
* These are some useful classes which I will need
*/
.l-box {
padding: 0.4em;
}
.l-box-lrg {
padding: 2em;
border-bottom: 1px solid rgba(0,0,0,0.1);
}
.is-center {
text-align: center;
}
/*
* -- PURE FORM STYLES --
* Style the form inputs and labels
*/
.pure-form label {
margin: 1em 0 0;
font-weight: bold;
font-size: 100%;
}
.pure-form input[type] {
border: 2px solid #ddd;
box-shadow: none;
font-size: 100%;
width: 100%;
margin-bottom: 1em;
}
/*
* -- PURE BUTTON STYLES --
* I want my pure-button elements to look a little different
*/
.pure-button {
background-color: #1f8dd6;
color: white;
padding: 0.5em 2em;
border-radius: 5px;
}
a.pure-button-primary {
background: white;
color: #1f8dd6;
border-radius: 5px;
font-size: 120%;
}
/*
* -- MENU STYLES --
* I want to customize how my .pure-menu looks at the top of the page
*/
.home-menu {
padding: 0.5em;
text-align: center;
box-shadow: 0 1px 1px rgba(0,0,0, 0.10);
}
.home-menu {
background: #2d3e50;
}
.pure-menu.pure-menu-fixed {
/* Fixed menus normally have a border at the bottom. */
border-bottom: none;
/* I need a higher z-index here because of the scroll-over effect. */
z-index: 4;
}
.home-menu .pure-menu-heading {
color: white;
font-weight: 400;
font-size: 120%;
}
.home-menu .pure-menu-selected a {
color: white;
}
.home-menu a {
color: #6FBEF3;
}
.home-menu li a:hover,
.home-menu li a:focus {
background: none;
border: none;
color: #AECFE5;
}
/*
* -- SPLASH STYLES --
* This is the blue top section that appears on the page.
*/
.splash-container {
background: #1f8dd6;
z-index: 1;
overflow: hidden;
/* The following styles are required for the "scroll-over" effect */
width: 100%;
height: 100%;
top: 0;
left: 0;
position: fixed !important;
}
.splash {
/* absolute center .splash within .splash-container */
width: 80%;
height: 50%;
margin: auto;
position: absolute;
top: 100px; left: 0; bottom: 0; right: 0;
text-align: center;
text-transform: uppercase;
}
/* This is the main heading that appears on the blue section */
.splash-head {
font-size: 20px;
font-weight: bold;
color: white;
border: 3px solid white;
padding: 1em 1.6em;
font-weight: 100;
border-radius: 5px;
line-height: 1em;
}
/*
* -- CONTENT STYLES --
* This represents the content area (everything below the blue section)
*/
#keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.content-caret img {
display: block;
margin-right: auto;
margin-left: auto;
animation: blink 2s;
animation-iteration-count: infinite;
}
.content-caret img.content-caret-bottom {
animation-delay: 0.1s;
transform: translate(0, -80%);
}
.content-caret img.content-caret-top {
animation-delay: 0s;
}
.content-wrapper {
/* These styles are required for the "scroll-over" effect */
position: absolute;
top: 87%;
width: 100%;
min-height: 12%;
z-index: 2;
background: transparent;
}
.content-wrapper-solid {
background: white;
}
/* This is the class used for the main content headers () */
.content-head {
font-weight: 400;
text-transform: uppercase;
letter-spacing: 0.1em;
margin: 2em 0 1em;
/*padding: 10px;*/
}
/* This is a modifier class used when the content-head is inside a ribbon */
.content-head-ribbon {
color: white;
}
/* This is the class used for the content sub-headers () */
.content-subhead {
color: #1f8dd6;
}
.content-subhead i {
margin-right: 7px;
}
/* This is the class used for the dark-background areas. */
.ribbon {
background: #2d3e50;
color: #aaa;
}
/* This is the class used for the footer */
.footer {
background: #111;
font-size: 11px;
}
/*
* -- TABLET (AND UP) MEDIA QUERIES --
* On tablets and other medium-sized devices, we want to customize some
* of the mobile styles.
*/
#media (min-width: 48em) {
/* We increase the body font size */
body {
font-size: 16px;
}
/* We want to give the content area some more padding */
.content {
padding: 1em;
}
/* We can align the menu header to the left, but float the
menu items to the right. */
.home-menu {
text-align: left;
}
.home-menu ul {
float: right;
}
/* We increase the height of the splash-container */
/* .splash-container {
height: 500px;
}*/
/* We decrease the width of the .splash, since we have more width
to work with */
.splash {
width: 50%;
height: 50%;
}
.splash-head {
font-size: 250%;
}
/* We remove the border-separator assigned to .l-box-lrg */
.l-box-lrg {
border: none;
}
}
/*
* -- DESKTOP (AND UP) MEDIA QUERIES --
* On desktops and other large devices, we want to over-ride some
* of the mobile and tablet styles.
*/
#media (min-width: 78em) {
/* We increase the header font size even more */
.splash-head {
font-size: 300%;
}
}
EDIT:
Here are a few pictures to explain what I mean.
From the Android default browser (which doesn't support CSS3 transitions and transforms, it seems): (OK)
From Firefox on Android: (NO HEADER, WEIRD BLUE BAR: NOT OK)
From my desktop's Firefox (resized to match a phone's dimension): (OK)
What's surprising is that it seems to only occur on firefox on Android. I also tried on an iPhone, and the result is as expected. Why that only happens from Github-pages and not from my local server is what startles me the most.
EDIT 2:
I just compared the css produced by Github Pages and the css produced by my server, and besides a few linebreaks and spaces here and there, they are identical. Could the difference reside in the HTML?

I've just reproduced this on Firefox 38 on Ubuntu.
While trying to find a box-model problem I saw this in my Firefox security console :
Blocked loading mixed active content "http://yui.yahooapis.com/pure/0.6.0/pure-min.css"[Learn More] nicowcow.github.io
Blocked loading mixed active content "http://yui.yahooapis.com/pure/0.6.0/grids-responsive-min.css"[Learn More] nicowcow.github.io
Blocked loading mixed active content "http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"[Learn More]
Then the problem might be here (see MDN documentation about MixedContent).
So, the solution is to request those three ressources over https.
This does work for Font-awesome at https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css but not for pure files (NET::ERR_CERT_COMMON_NAME_INVALID).
You will have to host them on your server or find another provider which serve over htpps.

Related

Move image up towards the header in the sidebar

I would like to move the circular image of myself located in the sidebar up and in line with my name displayed in the header. The contact and tech skills sections might need adjusting as well.
I have learned about absolute versus relative and how it relates to this, but I just can't implement a working solution.
This is what I have been working with:
<div style="position:relative; height:60px;">
<img src="profile_pic_circular.png"
style="position:absolute; top:-10px; left:-30px; width:80px; height:80px; border:none;"
alt="profile"
title="profile photo" />
</div>
Link to my resume with picture.
Code:
#import url("https://fonts.googleapis.com/css?family=Montserrat|Playfair+Display&display=swap");
/* Main text is monserrat*/
body {
font-family: "Montserrat", sans-serif;
font-weight: 300;
line-height: 1.3;
color: #444;
}
/* Give headers playfair font */
h1,
h2,
h3 {
font-family: "Playfair Display", serif;
color: #000;
}
/* When in PDF export mode make sure superscripts are nice and small and italic */
sup {
font-size: 0.45rem;
font-style: italic;
}
/* Avoid the breaking within a section */
.blocks {
break-inside: avoid;
}
* {
/* Override default right margin for sidebar*/
--pagedjs-margin-right: 0.2in;
--pagedjs-margin-left: 0.2in;
}
/* Customize some of the sizing variables */
:root {
--sidebar-width: 12rem; /* Shrink sidebar width */
--sidebar-background-color: #f7fbff; /* Make sidebar blue */
--sidebar-horizontal-padding: 0.01in; /* Reduce sidebar padding */
--decorator-outer-dim: 10px; /* Make position deliniating circles larger */
--decorator-border: 2px solid #bdd7e7; /* Make timeline a blue as well*/
}
.details .place {
margin-top: 0.25rem;
}
.main-block:not(.concise) .details div {
padding-top: 0.009rem;
}
/* Laptop icon isn't centered by default which is lame */
.fa-laptop {
margin-left: -3px;
}
/* When we have links at bottom in a list make sure they actually are numbered */
#links li {
list-style-type: decimal;
}
/* Dont put the little fake list point in front of links */
.aside li::before {
display: none;
}
/* Move closer to start and up towards header */
.aside ul {
padding-left: 1rem;
}
.aside li::before {
position: relative;
margin-left: -4.25pt;
content: "• ";
}
/* Make sure elements in asside are centered and have a nice small text */
.aside {
width: calc(var(--sidebar-width) + 9px);
line-height: 1.2;
font-size: 0.75rem;
}
/* Make little circle outline be a light blue */
.decorator::after {
background-color: #08306b;
}
/* Remove the fake bullets from lists */
.aside li::before {
content: auto;
}
.skill-bar {
color: white;
padding: 0.1rem 0.25rem;
margin-top: 3px;
position: relative;
width: 100%;
}
/* When the class no-timeline is added we remove the after psuedo element from the header... */
/* Removes the psuedo element on h2 tags for this section */
.section.no-timeline h2::after {
content: none;
}
/* Without adding padding the content is all up on the title */
.section.no-timeline h2 {
padding-bottom: 1rem;
}
/* Add styles for little cards */
.info-card{
width: 220px;
float: left;
padding: 0.5rem;
margin: 0.5rem;
box-shadow: 1px 1px 4px black;
}
I inspected the sidebar (right-click, choose Inspect) and saw that .aside had a padding. Remove it to align your picture with your headline.
padding: 0.6in var(--sidebar-horizontal-padding)

How can I get the spacing right please?

I'm not the greatest with HTML, but I'm also not the worse, as in I know how to locate and change things with instructions, but that's about it.
Is anyone able to help me please?
I am trying to get these two menu's separated/spaced out, ideally the main menu links to the left, and the social media links to the right, I have included two images below that hopefully explains what I'm looking to achieve.
This is how it looks on my site
This is how I want it to look
Hopefully I have put the right bit of code below, as I initially said I'm not great with HTML at all.
# 7. Navigation
-----------------------------------------------*/
#social-menu .social-links a {
color: $(topmenu.text.color);
}
#social-menu .social-links a:hover {
color: $(topmenu.text.hover.color);
}
.menu-wrap {
font-family: 'Poppins', sans-serif;
font-weight: 400;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 2px;
width: 100%;
z-index: 7;
word-break: break-word !important;
-webkit-font-smoothing: subpixel-antialiased;
text-align: center;
}
#menu-secondary {
max-width: 1180px;
margin: 0 auto;
border-top: 1px solid;
border-bottom: 1px solid;
}
#nav-secondary {
margin-bottom: 50px;
}
#nav-primary {
position: static;
height: 50px;
background: $(topmenu.bg.color);
}
.wrapper-nav-primary {
max-width: 92%;
margin: 0 auto;
position: fixed;
width: 100%;
background: $(topmenu.bg.color);
padding: 0 4%;
z-index: 999;
}
#menu-primary {
width: 70%;
float: left;
visibility: hidden;
}
#social-menu {
float: right;
margin-top: 18px;
}
.menu-wrap .widget {
display: inline-block;
}
.menu-wrap li {
display: inline-block;
position: relative;
}
.menu-wrap li,
.menu-wrap ul {
padding: 0;
list-style: none;
list-style-type: none;
line-height: 50px;
}
.menu-wrap li a {
margin: 0 30px;
font-weight: 400 !important;
}
#nav-primary li a {
color: $(topmenu.text.color);
}
#nav-primary li a:hover {
color: $(topmenu.text.hover.color);
}
Thank you in advance.
My guess is that you can add the following to the #social-menu. If you can supply the HTML implementation, and not only the CSS it will be easier to determine.
position: absolute;
right: 0px;
Thank you both again for your help, I feel very silly as the solution was simply going to the Blogger layout section and simply moving a box!
I spent the whole of yesterday trying to sort this, following various tutorials and guides changing the HTML and adding CSS haha.
The red HTML/JavaScript box in the primary menu section should be in the social media section below

Webpage displays differently on different screens

I'm trying to get my website to be display the way that it was designed. I have an iMac but when I view it on a MacBook Pro and my phone, the divs on one of my pages lose their proportions and it's not looking the way it should. Here's the link to my page:http://www.wintonbrownmusic.online/Music%20Site%20Beat%20Making.html
Here's the CSS for my page:
header, section, footer, aside, nav, main, article, figure {
display: block;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
a {
display: inline-block;
width: 90px;
text-align: center;
text-decoration: none;
font-family: Gagalin;
color: #404040;
font-size: 20px;
}
li {
width: 100px;
margin: auto;
display: inline;
}
p {
font-family: Arial;
padding-left: 10px;
}
a:hover, a:active {
padding-bottom:8px;
background: transparent;
border-bottom: 3px solid #FA8440;
}
a:active {
color: #FA8440;
}
.newspaper {
-webkit-columns: 100px 3; /* Chrome, Safari, Opera */
-moz-columns: 100px 3; /* Firefox */
columns: 100px 3;
font-family: Arial;
}
h2 {
font-family: Gagalin;
padding-left: 10px;
}
footer {
background-color:black;
color:white;
clear:both;
text-align:center;
padding:5px;
}
.blurb {
margin:5px 0 10px 10px;
width:425px;
height: 230px;
background:#1a1a1a;
border: 6px solid #4d4d4d;
padding: 30px;
float: right;
font-family: Arial;
color: White;
padding-right:50px;
}
.container-fluid {
margin: 0 auto;
margin-left: 0 auto;
width: 65%;
}
I could use some assistance on what code I can use to make this page appear the same in all browsers, all pages and even phones.
Its a resolution problem(or cross browser issue) since I see your fixing width and height in ur css.
There are 2 Solutions to ur problem:
make your containers/divs by percentage, even after doing that you may still face some issues.
What I would recommend is scrap existing html and redo it using a styling framework like bootstrap(http://getbootstrap.com/) this would allow you to make your website responsive and it wont break on different browsers.
The problem is that the design is not responsive (does not naturally adjust to different screen sizes and formats). Responsive design is a huge topic that can't really be covered in the contents of once conversation box, so I am adding some links for you to look at.
Responsive web design basics:
https://developers.google.com/web/fundamentals/design-and-ui/responsive/
Media queries:
https://www.w3schools.com/css/css_rwd_mediaqueries.asp

Why does media query only work when placed last in my CSS?

I'm learning css and I came across an example that has the following code:
<body>
Hearts
Clubs
Spades
Diamonds
</body>
and css:
.CardLink {
display: block;
color: #666;
text-shadow: 0 2px 0 #efefef;
text-decoration: none;
height: 2.75rem;
line-height: 2.75rem;
border-bottom: 1px solid #bbb;
position: relative;
}
#media (min-width: 300px) {
.CardLink {
padding-left: 1.8rem;
font-size: 1.6rem;
}
.CardLink:before {
display: block;
}
}
.CardLink:before {
display: none;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
}
.CardLink_Hearts:before {
content: "❤";
}
.CardLink_Clubs:before {
content: "♣";
}
.CardLink_Spades:before {
content: "♠";
}
.CardLink_Diamonds:before {
content: "♦";
}
/*#media (min-width: 300px) {
.CardLink:before {
display: block;
}
}*/
The idea is when the viewport size is below 300px then the card icons are not displayed, otherwise, it shows them.
I was playing around with the code and I can't understand why we have to define #media (min-width: 300px) twice for the code to work as expected.
Why can't we just put the code in the last paragraph of the css to the section where media screen size belongs (good code reuse instead of declaring this again ) ?
If I do this then no icons are displayed (this is the code below).
Could anyone explain ? Check the plunker, this works as expected: https://plnkr.co/edit/MJAPdkgUegpUlJnkcQHg?p=preview
Because you're working with Cascading Style Sheets.
A cascade is like a waterfall: The rendering engine starts at the top of the source document and works its way down.
In this case, it sees your media query. Then it sees the rest of your code, which takes precedence because it comes later.
For instance, let's say your stylesheet had this:
div { color: red; }
div { color: blue; }
div { color: red; }
Your text color will be red.
In this case:
div { color: red; }
div { color: blue; }
Your text color will be blue.
In both cases, CSS picks the last declaration in the stylesheet.
If you want your media query to take precedence, put it at the end of your code.
(It seems simple and often it is. Just make sure to learn about CSS specificity.)
It's about the placement, put the media query after the :before's and it will be ok
.CardLink {
display: block;
color: #666;
text-shadow: 0 2px 0 #efefef;
text-decoration: none;
height: 2.75rem;
line-height: 2.75rem;
border-bottom: 1px solid #bbb;
position: relative;
}
.CardLink:before {
display: none;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
}
.CardLink_Hearts:before {
content: "❤";
}
.CardLink_Clubs:before {
content: "♣";
}
.CardLink_Spades:before {
content: "♠";
}
.CardLink_Diamonds:before {
content: "♦";
}
#media (min-width: 300px) {
.CardLink {
padding-left: 1.8rem;
font-size: 1.6rem;
}
.CardLink:before {
display: block;
}
}
Hearts
Clubs
Spades
Diamonds

KendoUI Responsive Panel - Fixed Header and Sidebar when scrolling

I am trying to create a layout using a fixed header and sidebar (when visible/active) that does not disappear when scrolling, hope the http://jsfiddle.net/goltech/tfx1j6uh/ explains it better? Using the KendoUI ReponsivePanel and the demo from Kendo website. Thanking You
#sidebar {
/* panel background should be set to match design */
background: #092646;
}
article {
/* clear the floating sidebar */
overflow: hidden;
}
html, body {
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
}
header {
padding: 1em;
color: #fff;
background-image: linear-gradient(to top, #014F80 0%, #092646 100%);
}
h1 {
display: inline;
}
p {
padding: 2em;
}
nav a {
border: 1px solid #ccc;
background: #ddd;
display: block;
text-decoration: none;
padding: .5em;
}