I am using XAMPP and MyPHPadmin to setup a survey with a database that I will be using for a project.
Now I am trying to link my css file to my html file so that the layout changes. I am trying to link this with:
<link type="text/css" href="/Versie1.1/default.css" rel="stylesheet">
My css file is located at: C:\xampp\htdocs\Versie1.1\default.css
I have tried a lot of different hrefs as in: "default.css", c path to the default.css, etc.
Any idea why my layout is not changing to the one in the css file? If I put the css code inside the <head> it does work.
it's seems, some path problem.
If your porject file path is "C:\xampp\htdocs" in this path you have one folder 'Versie1.1' and a html file index.html, then your "href=Versie1.1/default.css"
file structure
Versie1.1
default.css
index.html
file structure
Versie1.1
default.css
html
index.html
In this case link will be "href=../Versie1.1/default.css"
I hope you understand. Thank you!
Related
I just started using html and css and I have to do something with it but I am getting the error Unable to open 'style.css'. I don't know what the problem is since the path that I used is the same as the file path.
Make sure the CSS file and the HTML file are in the same folder.
based on your image it should be
href="mywebs\site\style.css"
if you want to link site/style.css to mywebs/smth.html you should go one folder back.
<link href="../site/style.css">
or put the site folder inside mywebs, because based on the picture the site folder is not inside mywebs folder.
Sometimes the file may missed directory. You can close and open the code editor and it will work. Also, make sure your html and css file is in same directory. If you css file is in a different directory then use the following code:
<link type="text/css" href=".../style.css"/>
I am doing some HTML & CSS tutorials, and I am unable to get my CSS to appear when I load my web pages.
I linked my CSS to the HTML skeleton.
Can you help me figure out the error?
Screenshot of my HTML document:
Screenshot of my CSS:
Both of the files are stored in the same folder:
If anyone could let me know where I went wrong so I could continue my process, I would appreciate it.
The index.html and the styles.css are in the same folder, so you shouldn't point to a sub-directory for the css. Try this:
<link rel="stylesheet" href="styles.css">
as both index.html and css files are in same folder, you can use
<link rel="stylesheet" href="styles.css?v=1.1.2">
here, v is version declared, so whenever you make changes in your css file, simply change this version numbers to get refresh css and changes to take effect in browser without cleaning caches..
you can also move your css file in stylesheets folder and can keep index.html structure as it is.... basically it is good practice to keep files in subfolders so we can find them easily when searching... for e.g. all .css files in stylesheet folder, all images in images or img folder, all javascripts in js folder...
by the way, what is m.m in css file, in body styling ??
I have made a .css file for a html i'm using in a dynamic web project. The css implementation clearly works because if i run the tomcat server from the html i can clearly see the css effect but if i run it from the main project it opens the same html page but without the css effect. How am i supposed to fix this? Do i have to write something into the web.xml file ?
This is the link tag in the html file
<link rel="stylesheet" type="text/css" href="style.css"/>
Am i supposed to add something else ?
it depends on location of css file. Your path will if css is in same folder as html/jsp file. If it is in sub folder in webcontent folder then use href="foldername/filename" if its in root folder then href="../foldername/filename"
I have a folder structure like this:
src
assets
scss
layout
layout.scss
pages
index.scss
layout
site-header.html
site-footer.html
pages
index.html
index.html
css
layout.css
index.css
js
The sass files in /scss folder is compiled to /css folder.
I linked the /css/layout.css in the /src/layout/site-header.html file.
The /css/index.css is linked in /src/pages/index.html file.
I want to use something(gulp plugin) to generate the /index.html in the root folder.
This file is comprised of the /src/layout/site-header.html, /src/pages/index.html, /src/layout/site-footer.html, and most importantly, put the /css/index.css link in the head part of the file.
How can I do this? I looked for gulp plugins, but I only find https://www.npmjs.com/package/gulp-file-include, which cannot put the css link in the head section of the html file. :'(
Thanks in advance. :)
Please help to rephrase the title if it is inappropriate. :)
:D I've found out I can use gulp-file-include to do the work :D
In the /src/pages/index.html I can pass the view css as in json format into layout file like this:
##include('../layouts/site-header.html', {"viewCSS":"/css/pages/index.css"})
Then in /src/layout/site-header.html I can do:
<link rel="stylesheet" href="##viewCSS">
It outputs:
<link rel="stylesheet" href="/css/pages/index.css">
:)
My css style link isnt working
I am a beginner and am trying to make a website.
I wrote the link in the header tag.
<link rel="stylesheet" type="text/css" href="styles/main.css"/>
First locate the folder where you saved your HTML file.
Create a folder named styles
In that styles folder, create your css file named main.css
Open that "main.css" file with notepad or notepad++(what you feel comfortable with), write your css code and save it.
That should work!