why the sass codes don't apply to my html - css

p{
color: blue;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="sport.scss">
</head>
<body>
<p>Helllooo</p>
</body>
</html>
I wrote two other pages in this project correctly. But, when intended to code the third one, changes didn't apply at all.it seems that my html code doesn't receive the styles.
Surprisingly, the sass file fully converted to CSS file, and no problem was evident.

SASS / SCSS is a preprocessor for CSS, and can't be interpreted by your browser.
This is a duplicate question and possible solutions have alredy been described here: Attaching a SCSS to HTML docs

if you are using vs code download a sass extension which will convert your sass code into a css code and then you can link that css file generated by the extension to your html page
i will recommend scss-to-css extension by yutent as it doesn't require you to make it active like other extensions

you must read documentation sass official and follow this guide https://sass-lang.com/guide. if you not install sass this two way how install sass
read this https://sass-lang.com/install
or download extension in visual code
if you are still confused change your sass become sport.css

Related

Why CSS is not working on my github pages?

I'm trying to deploy my react app on github as pages but the css isn't working. Im attaching my github repository if anyone can help.text.
As right now the page is looking totally messed cause not css is applied.
cLooking at generated index.html file in the gh-pages branch, I can see that the file is malformed; you have missing closing tags in your HTML.
// index.html (I added newlines for readability)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link>font-family: "Montserrat", sans-serif; href="https://fonts.googleapis.com/css?family=McLaren|Montserrat&display=swap" rel="stylesheet"
<link>rel="stylesheet" href="./styles.css"
...
Notice the link tags aren't closed. Because of this, the CSS file will not be loaded by the browser.

Rubymine css code completion does not work

Simple html file with attached css file. Code completion does not work. (inline css does)
I've spent lots of hours trying to figure it out. Hope this will save some time for those who are still struggling. See the answer below.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<link rel="stylesheet" href="style.css">
</head>
<body>
</body>
</html>
Autocompletion will not work if Code Insight feature is disabled.
So my problem was with the big css file. Actually, it's a regular size file (tailwind css processed by postcss with autoprefixer plugin).
Css file was around 3MB, but code insight stops working for files that bigger than 2.5MB by default.
The solution is to increase filesize limit.
Go to Help > Edit Custom Properties
Paste config
# Maximum file size (kilobytes) IDE should provide code assistance for.
idea.max.intellisense.filesize=10000
Save and restart

reactjs navbar design proglem(using bootstrap css internally)

I have a problem with the navigation bar,
I have a navigation bar for my project. As you can see my code below if I use the link and get it from an external source it is working well. But there is a problem for me when the net is a bit slow I can see the navigation's loading on my screen. it is a very small duration but it disturbs me very much. So I decided to use CSS source from my project folder but could not do that. I tried many code samples but could not do it correctly. If somebody helps me, I will appreciate it. Thanks.
I am also still trying to solve it but I wanted to get some help.
function MyNavBar(params) {
//console.log(params["conpanyID"]);
return (
<div>
<head>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
/>
</head>
1-When I use link/external source
[1]: https://i.stack.imgur.com/SO5qB.png
2-When I use CSS file from my project folder.
[2]: https://i.stack.imgur.com/MqHqo.png
you might have linked your stylesheet inside the body instead of the header section , because of which your page will load first, then your CSS
here is an example
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>file</title>
<link rel="stylesheet" href="css/s.css">
<link rel="icon" href="css/si.ico">
</head>

Font Awesome class "fa-check" is not displaying check mark

I have a simple html page using font awesome css. Can anyone see why my font awesome check mark is not displaying, I cannot get the check mark to display and I cannot seem to figure out why.
I am using the .min.css link in my <Head> as such:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>LoopLAB Theme</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
</head>
When I want to inject it into a <i> element in the DOM, I simply use this:
<i class="fa fa-check"></i>
As you can see above, the check mark does not display. Do you see anything obvious that I am doing wrong? This seems like a beginner's error but I can't find the problem.
Check your CSS. There are a few ways you can do that!
Simply check if font-awesome.min.css is indeed under your CSS folder. If it is, check your folder structure. Can your HTML access this folder using css/font-awesome.min.css? The CSS folder must be a child from the folder you are currently storing your HTML file. Finally, are you using the latest version of font-awesome-min.css? This specific icon might not be included in your CSS file if it's an older version.
Inspect your site using your favorite browser inspect tool and locate your CSS file on inside the inspector. Clicking on it should open your CSS code. The code should be minified. If there is nothing inside of it or some kind of error your website is failing to find your file on your server or computer.
Plus you can also add from a CDN, for example, https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css and import directly to your code.

I renamed my css file and now it doesn't work

Doing a website for a client and I merely changed the name of the css file in the folder and in the references on each page. And suddenly all my styling is gone. I've checked multiple times for spelling errors and it's all correct and I do believe I have referenced it correctly as it was working previously under a different name. My Question is How can the changing of the css file suddenly stop it working if it's still referenced correctly? Could it be that bootstrap is overriding it somehow?
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/main.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/bootstrap.min.js"></script><!--Reference Bootstraop.min before plugins.js but after jquery.js. We alterbootstrap javascript with plugins.js -->
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</head>
Here is the <head> for my index html file.
The problem only occurred when I changed the file names but I can't leave it as "TestLayout" when it is a completed project. Any help is appreciated and I can supply what I can to help find the solution. Thanks in advance.
First off, a small tip: Load your custom CSS-file AFTER the bootstrap.css file. This way you can ensure that your styles are easily overriding the defaults of Bootstrap, so you don't have to bash in !important in order to change something.
And for your question, have you accidentally removed css/ from the beginning of your style.css? Since all the other CSS styles you have linked are under the CSS-folder.
Double check that, otherwise it should work, the name is valid.
If the path to your CSS file is still correct (and you haven't inadvertently removed the folder from the file path as per ProDexorite's answer) then you might need to completely refresh your browser.
You can do this with CTRL+F5 or to be completely sure you can empty your browser cache, although I usually find this isn't necessary.
ProDexorite is also correct regarding the CSS files - it's called Cascading Style Script which means any styles in the files you load last will overwrite the files loaded before. Therefore any custom CSS (main.css and style.css for example) should be loaded AFTER the Bootstrap or any other library css files. This just means you need to reference them in the right order in your page that's all.

Resources