I am attempting to make a horizontal navigation bar in a jekyll site. I am not sure if the CSS I am using is incorrect, or if it's not compiling correctly with Jekyll.
Here is my current approach:
- Make changes in _scss/_layout.css
- Check the changes are there in _site/main.css (they are)
- Check for errors in jekyll serve console (don't see any)
When I look at my generated site and hit inspect, I don't see the CSS changes being applied.
Sass code in _sass/_layout.scss:
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
li {
list-style-type: none;
margin: 0;
padding: 0;
}
h1 {
text-align: center;
font-weight: 200;
}
header {
background: $header;
padding: 0px 15px;
text-align: center;
margin: 50px 0 0;
height: 50vh;
display: flex;
justify-content: center;
align-items: center;
}
Full repo for my site is here - https://github.com/ericadohring/groupdayout/ and help would be greatly appreciated!
Github pages isn't showing changes anymore because there is an error that prevents Jekyll to build your site.
In _sass/_layout.scss there is a property that is using an undefined variable:
header {
background: $header;
...
}
To fix it just assign a value to it before using the variable, e.g.:
$header: #f0ad4e;
header {
background: $header;
...
}
Now you will be able to work on your site and seeing the changes reflected in Github pages.
Related
I'm trying to start this lines of text on the same left level, but I'm having problems doing it.
CSS code:
.sideBar-footer {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
bottom: 10px;
}
.sideBar-footer-image {
width: 50px;
height: 50px;
background-color: #D9D9D9;
border-radius: 10px;
}
.sideBar-footer-text {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.sideBar-footer-text h1 {
font-size: 15px;
font-weight: 500;
line-height: 15px;
color: #FFFFFF;
}
.sideBar-footer-text p {
font-weight: 400;
font-size: 12px;
line-height: 14px;
color: #FFFFFF;
}
Can you please help me solve this?
You need to debug why is it showing the space before. To do that, right-click on the <p> tag in the browser and inspect the element. Then you want to go to the 'Layout' in the styles section of the inspector and check if the element has any spacing.
You'll probably see something like this
You can see I have a 10px padding (violet area)
After Understanding what is causing your element to be more to the right, probably margin/padding you can search for the rule where I put "You can search here" on the image
This way you will understand why you are seeing this space and where is it coming from.
To override you can just add a rule to your ".sideBar-footer-text p" set of rules something like
padding: 0 or margin: 0
depending on what is causing the space.
Also, you can see your h1 has a big margin below it, you should probably add a CSS reset on your project. You can do so by adding the snippet below at the topmost CSS import right at the beginning of the file.
* {
padding:0;
margin:0;
vertical-align:baseline;
list-style:none;
border:0
}
I cant for the life of me figure out how to edit the style.css file to edit the width of the top navigation bar. our website as you can see, the top nav bar is too large, all the items should fit on one line. Here is the code:
.top-nav {
background: #151515 none repeat scroll 0 0;
}
.nav-top li {
display: inline-block;
}
.top-nav a,.nav-video a {
color: #fff;
display: block;
font-family: josefin_sansbold,sans-serif;
font-weight: 200;
padding: 25px 15px;
text-transform: uppercase;
position:relative;
font-size:30px;
}
.top-nav{
text-align: center;
}
div#Video_Categories {
padding: 10px 5px;
background: #fafafa;
}
#nav a {
color:#004282 !important;
font-size:18px !important;
}
There is also a chance that I may be looking at the relavent code for the top menu bar. I could attach the full css file here if possible. Bare with me this is my first post!
If you have the ability to override your current styles or edit them, then you can change the width of the class .container_24.
.container_24 {
max-width: 1200px;
}
Changing that gives me this:
So someone has asked something fairly similar before but didn't get an answer.
I am learning SASS and am using the live sass compiler in vs code but it is not updating anything. The only way I can get the app.css file to show the changes is to press the watching button and basically reset the thing. It didn't used to do this. All changes were shown as soon as I saved the file. There doesn't seem to be anything in the output terminal that shows an issue. Is this the only way to see live changes in sass files when working in a local environment or is there a better way.
.header {
height: 8vh;
background-color: #131921;
position: sticky;
top: 0;
z-index: 100;
align-items: center;
display: flex;
color: #fff;
padding: 30px 20px;
&__logo {
width: 100px;
object-fit: contain;
margin: 0 20px;
}
&__search {
display: flex;
flex: 1;
align-items: center;
border-radius: 35px;
}
&__searchIcon {
padding: 5px;
height: 36px !important;
width: 36px !important;
background-color: #cd9042;
border-radius: 0 6px 6px 0 !important;
}
&__searchInput {
padding: 10px;
border: none;
width: 100%;
border-radius: 6px 0 0 6px !important;
}
&__nav {
display: flex;
justify-content: space-evenly;
}
&__boxes {
display: flex;
flex-direction: column;
align-items: flex-start;
color: #fff;
margin: 0 10px;
text-transform: capitalize;
text-align: left;
}
&__boxesFirstLine {
font-size: 12px;
line-height: 14px;
font-weight: 400;
color: rgba(255, 255, 255, 0.7);
}
&__boxesSecondLine {
font-size: 14px;
font-weight: 700;
line-height: 15px;
padding-bottom: 5px;
padding-right: 9px;
}
&__basketText {
color: #fff;
font-size: 14px;
line-height: 15px;
font-weight: 700;
padding-bottom: 5px;
padding-right: 9px;
text-transform: capitalize;
}
}
For all those facing issues with Live Sass Compiler not watching. Here is the solution.
After our extension is installed in VScode, we are going to look at some settings.
Go to settings (Click on the settings icon on bottom-left corner of your VSCode, and in the menu that appears click on settings).
Then a Search field will appear at the top, we will type and search for Live Sass Compiler.
Click on Live Sass Compiler once it appears and again click on Edit in Settings.json link and add following json:
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/dist/css"
}
],
Save and we are good to go.
STEPS: Providing Images for ease.
Now FOLDER STRUCTURE:
a) After creating your project folder in any of your Disk drives. Open it in VSCode and create the dist folder within project folder/ root of your project. And create an index.html file within the dist folder.
b) Then create another folder within the root folder and we are going to name it scss and within here we are going to create a main.scss.
c) Then we can click on Watch Sass at the bootom of VSCode, Now Live Sass Compiler will keep watching for any changes in the main.scss and based on our path set in settings.json, it will automatically create the css folder within the dist folder and a main.css file as well which ultimately goes to production.
got myself in a tight spot here, the widget on the right hand side of my website has lost its formatting, i need it all in one line, and to drop below the left hand widget when viewed in mobile: https://aurexgroup.com/
Im using a enfold child theme on a wordpress site.
i assume its a css issue, but i cant find the code that relates.
i have looked through the css style sheet in the theme, this is all i could for widgets find:
}
#top li.sf-widget-element{
list-style: none;
clear: none;
margin-left: 0;
padding: 0;
width:auto;
display:inline-block;
margin-right: 30px;
}
And then this in the quick css section in the enfold general styling tab:
}
#footer .flex_column{
float: right;
}
#footer .flex_column.first{
float: left;
}
.footer_color a, .footer_color .widget_first{
color: #cf5c1a !important;
}
#footer .flex_column .widget{
margin-top: 0;
margin-bottom: 0;
line-height: 26px;
display: inline-block;
width: 100%;
}
.copyright a[href*="kriesi"]{
display:none !important;
}
Very open to any ideas!
please help!
I have a page here: http://dev.textcube.ch/oneandonly/index.php/galerie/shima/ where the subnav is ok using the style #vertmenu however on another page where the styling and page layout is identical the subnav is pushed to the left http://dev.textcube.ch/oneandonly/index.php/galerie/yuma/
(username: textcube / password: textcube3600 as a login will popup to access the pages)
#vertmenu {
font-family: Arial, Helvetica, sans-serif;
font-size: 100%;
margin-top: 20px;
float: left;
clear: both;
background: url(../images/subnav_bg.png) no-repeat;
height: 180px;
width: 195px !important;
padding: 40px 60px 60px 20px !important;
}
I've no idea of why this is, I've checked the CSS and inspected the elements in Chrome on both pages to see if there is any conflicts and I can't see anything.
Please can anyone help me out?
Thanks
In the second page, you include view.css, which has the following rule:
* {
margin: 0;
padding: 0;
}
This removes the default padding on the ul. You just need to add the following declaration to your #vertmenu .nav rule:
padding-left: 40px;
By checking both the pages the extra thing in the second page is the presence of margin:0; padding:0 via view.css. It causes the layout breaking.